Yii Framework Forum: Awecrud - Yii Framework Forum

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Awecrud A new way to generate code Rate Topic: -----

#21 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 19 November 2012 - 04:22 PM

Just released a new version of AweCrud adding support for "defaultAction" property in controller.
Download it, Take a look and feel free to report any bug you find.


Go to AweCrud
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#22 User is offline   bbunlock 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 20-May 12

Posted 25 November 2012 - 06:35 PM

Hi I have installed this extension but cannot get it to work in gii? it shows up on the left menu but when I click on either awemodel or awecrud I get the following error

"Error 404
Unable to resolve the request "gii/AweModel"."

I have added the extension to the protected/extensions folder, I have added it to the import array next to others, this si what my import array looks like

// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.user.models.*',
		'application.modules.user.components.*',
		'application.modules.rights.*',
		'application.modules.rights.components.*',
    'ext.AweCrud.components.*', // AweCrud components
	),


I have added it to my generator paths as shown below

'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'william1',
			
			// generator paths
        'generatorPaths'=>array(
        	'bootstrap.gii', // bootstrap yii booster
        	'ext.AweCrud.generators', // AweCrud generators
        ),
        
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),


can anyone suggest why this doesnt work?

thanks in advance

wayne
0

#23 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 26 November 2012 - 06:51 AM

Please check that you have something like this in your urlManager/Rules:

        'urlManager' => array(
            'urlFormat' => 'path',
            //'showScriptName' => false,
            'rules' => array(
                'gii' => 'gii',
                'gii/<controller:\w+>' => 'gii/<controller>',
                'gii/<controller:\w+>/<action:\w+>' => 'gii/<controller>/<action>',
...



Regards
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#24 User is offline   bbunlock 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 20-May 12

Posted 26 November 2012 - 09:47 AM

Hi Ricardo thanks for the quick reply, I have checked my url manager and it all seems to be working fine, however I have pasted it below just in case you see something, I am not just having this problem with your extension but with others as well, and yet some extensions work? for example I have yii booster bootstrap extension and that works fine in the gii console, but others like yours do not work but they do appear in the left menu.

// url manager
		'urlManager'=>array(
      'caseSensitive' =>false,
 			//'showScriptName'=>false,
			'urlFormat'=>'path',
			'rules'=>array(
			
			// main index
   			'/' => 'site/index',
   			
   			// login / logout / register / forgot password / forgot username
   			'Login' => 'user/login',
   			'Register' => 'user/registration',
   			'Forgot-Password' => 'user/recovery',
   			
   			// user section
   			'Profile/<id:\d+>' => 'user/profile',
   			
   			'Contact' => 'site/contact',
   			
   			'About' => array('site/page', 'defaultParams' => array('view' => 'about')),
			
	// gii url
            'gii'=>'gii',
            'gii/<controller:\w+>'=>'gii/<controller>',
            'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',
   			
   			// default url code
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),


again thanks for any help

wayne
0

#25 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 26 November 2012 - 10:09 AM

I'm not sure about the reason of this error, however, I recommend to move "'/' => 'site/index'," to the very bottom, just above "//default url code".
It maybe helps.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#26 User is offline   bbunlock 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 20-May 12

Posted 26 November 2012 - 10:49 AM

thanks Ricardo I tried that but still get the error, I have tried to install a few other gii extensions such as giix and gtc but they are the same at least for model and crud, some of the other generators in gtc work?

just in case it is relevant I am running this yii on my windows 7 machine with xamp 1.8.1 and PHP Version 5.4.7 and Apache/2.4.3 (Win32)

I have even tried it on a brand new app (testdrive) created from the command propt in framework and still get the 404

regards

wayne
0

#27 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 26 November 2012 - 03:32 PM

Pretty weird...
Can you post a screenshot with the error message? Maybe we can help.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#28 User is offline   bbunlock 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 20-May 12

Posted 26 November 2012 - 04:09 PM

there is no real error just a 404 I but have included a screenshot of screen and also of the error part in the CWebLogRoute

Posted Image

Posted Image

regards

wayne
0

#29 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 04 December 2012 - 08:42 AM

@bbunlock Were you able to find the reason of the bug?
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#30 User is offline   luc 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 211
  • Joined: 22-June 10
  • Location:france

Posted 04 December 2012 - 09:17 AM

Hi,

I've just installed the new versio of AweCrud, and now while generating crudCode, I've got:
Undefined variable: model 


in: protected/extensions/AweCrud/generators/AweCrud/templates/default/_form.php(9)
Hey Ho !
Let's go !
0

#31 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 05 December 2012 - 03:17 PM

Could you please post all the backtrace?
Thanks.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#32 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 05 December 2012 - 09:07 PM

This bug will be fixed in the next release. Hopefully in a few hours.
Thanks for reporting.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#33 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 05 December 2012 - 09:25 PM

Last version released, please feel free to download from Exntesions page: http://www.yiiframew...ension/awecrud/
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#34 User is offline   luc 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 211
  • Joined: 22-June 10
  • Location:france

Posted 06 December 2012 - 04:37 PM

View Postrobregonm, on 05 December 2012 - 09:25 PM, said:

Last version released, please feel free to download from Exntesions page: http://www.yiiframew...ension/awecrud/


Thank you. It Works well now.
Hey Ho !
Let's go !
0

#35 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 09 December 2012 - 06:28 PM

Glad to hear that it it working well.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#36 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 14 December 2012 - 05:24 PM

Version 0.9 released. Feel free to download and report any bugs you find.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#37 User is offline   Sean Kumar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 21-July 11

Posted 20 December 2012 - 12:44 PM

Getting this error after generating CRUD

Declaration of ListingController::loadModel() should be compatible with AweController::loadModel($key, $modelClass)

Have the latest Yii release and on PHP 5.4. Any suggestions?

EDIT:
Another error when attempting to generate crud for another table. Which has a primary key.

Undefined variable: identificationColumn
\protected\extensions\AweCrud\generators\AweCrud\templates\default\_view.php(72)

60             <div class="field_value">
61                 <?php if (in_array($column->dbType, $this->dateTypes)): ?>
62                 <?= "<?= Yii::app()->getDateFormatter()->formatDateTime(\$data->{$columnName}, 'medium', 'medium') ?>\n" ?>
63                 <br/>
64                 <?= " <?= date('D, d M y H:i:s', strtotime(\$data->" . $columnName . ")) ?>\n" ?>
65                 <?php elseif (in_array($column->dbType, $this->booleanTypes)): ?>
66                 <?= "<?= CHtml::encode(\$data->{$columnName} == 1 ? 'True' : 'False') ?>\n" ?>
67                 <?php elseif (in_array(strtolower($columnName), $this->emailFields)): ?>
68                 <?= "<?= CHtml::mailto(\$data->{$columnName}) ?>\n" ?>
69                 <?php elseif (in_array($column->dbType, array('longtext'))): ?>
70                 <?= "<?= nl2br(\$data->{$columnName}) ?>\n" ?>
71                 <?php elseif (in_array(strtolower($columnName), $this->imageFields)): ?>
72                 <?= "<img alt=\"<?= \$data->{$identificationColumn} ?>\" title=\"<?= \$data->{$identificationColumn} ?>\" src=\"<?= \$data->{$columnName} ?>\" />\n" ?>
73                 <?php elseif (in_array(strtolower($columnName), $this->urlFields)) : ?>
74                 <?= "<?= AweHtml::formatUrl(\$data->{$columnName}, true) ?>\n" ?>
75                 <?php else : ?>
76                 <?= "<?= CHtml::encode(\$data->{$columnName}) ?>\n" ?>
77                 <?php endif; ?>
78             </div>
79         </div>
80 
81         <?php if (!in_array($column->dbType, $this->booleanTypes)): ?>
82             <?= "<?php endif; ?>\n" ?>
83             <?php endif; ?>
84         <?php endif; ?>


Thanks
Sean
0

#38 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 24 December 2012 - 11:00 AM

First of all, please, make sure you are using the last version of AweCrud (version 0.9).

And now, could you please post the generated code with the error? if you can post the table fields and the model it would be great too.

I'm currently fixing the "_view.php line 72" bug, that it's due to the generator detected an "image" field. A workaround cold be to comment lines 71 - 72.

Regards.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#39 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 24 December 2012 - 11:33 AM

Another good (& functional) workaround is to replace line 72 to:

<?= "<img alt=\"<?= \$data ?>\" title=\"<?= \$data ?>\" src=\"<?= \$data->{$columnName} ?>\" />\n" ?>


Regards
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

#40 User is offline   robregonm 

  • Expert Yii Developer
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 30-July 09
  • Location:Colombia

Posted 10 February 2013 - 08:22 PM

New version 0.10 released! It fixes several bugs when PHP 5.2 is used (thanks to @franhb).
Also it fixes the bug with the images link reported by @Sean.
Feel free to download it and report any bugs you find.
Ricardo Obregón

YiiFramework en Español - http://yiiframework.co/ - http://yiiframeworkenespanol.org/ - Yii Code Generator for Bootstrap
http://obregon.co/ - https://1server.co/
PHP 5.5+, nginx 1.7, MySQL(MariaDB & PerconaDB), PostgreSQL 9, Yii 2, CanJS
Follow me: @robregonm & @obregonco & @1ServerCo.
0

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users