Awecrud A new way to generate code
#21
Posted 19 November 2012 - 04:22 PM
Download it, Take a look and feel free to report any bug you find.
Go to AweCrud
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#22
Posted 25 November 2012 - 06:35 PM
"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
#23
Posted 26 November 2012 - 06:51 AM
'urlManager' => array( 'urlFormat' => 'path', //'showScriptName' => false, 'rules' => array( 'gii' => 'gii', 'gii/<controller:\w+>' => 'gii/<controller>', 'gii/<controller:\w+>/<action:\w+>' => 'gii/<controller>/<action>', ...
Regards
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#24
Posted 26 November 2012 - 09:47 AM
// 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
#25
Posted 26 November 2012 - 10:09 AM
It maybe helps.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#26
Posted 26 November 2012 - 10:49 AM
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
#27
Posted 26 November 2012 - 03:32 PM
Can you post a screenshot with the error message? Maybe we can help.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#28
Posted 26 November 2012 - 04:09 PM


regards
wayne
#29
Posted 04 December 2012 - 08:42 AM
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#30
Posted 04 December 2012 - 09:17 AM
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)
Let's go !
#31
Posted 05 December 2012 - 03:17 PM
Thanks.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#32
Posted 05 December 2012 - 09:07 PM
Thanks for reporting.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#33
Posted 05 December 2012 - 09:25 PM
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#34
Posted 06 December 2012 - 04:37 PM
robregonm, on 05 December 2012 - 09:25 PM, said:
Thank you. It Works well now.
Let's go !
#35
Posted 09 December 2012 - 06:28 PM
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#36
Posted 14 December 2012 - 05:24 PM
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#37
Posted 20 December 2012 - 12:44 PM
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
#38
Posted 24 December 2012 - 11:00 AM
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.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#39
Posted 24 December 2012 - 11:33 AM
<?= "<img alt=\"<?= \$data ?>\" title=\"<?= \$data ?>\" src=\"<?= \$data->{$columnName} ?>\" />\n" ?>
Regards
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.
#40
Posted 10 February 2013 - 08:22 PM
Also it fixes the bug with the images link reported by @Sean.
Feel free to download it and report any bugs you find.
Support me on Patreon: https://www.patreon.com/yiiframework
Promover Yii Framework en Español en Patreon: https://www.patreon....yiiframework_es
YiiFramework en Español: http://yiiframework.es/ - Canal de YouTube - Facebook
Follow me: @robregonm.