Awecrud


(Ricobregon) #1

I’ve uploaded a new extension called AweCrud, the tries to simplify and enhance the code generation using Gii and Bootstrap look-and-feel.

For more information:

http://www.yiiframework.com/extension/awecrud/


(Luc Pfister) #2

Hi, thank you for sharing your work.

Two errors I’m facing:

While using AweModel generator, when a table has a "created_at" field, the generator return a CException:


Property "AweModelCode.create_time" is not defined.

in:

extensions/AweCrud/generators/AweModel/AweModelCode.php(408)

While using CRUD generator, I’ve got “PHP Notice”:


Undefined variable: identificationColumn

in:

extensions/AweCrud/generators/AweCrud/templates/default/_view.php(32)


(Ricobregon) #3

Hi Luc,

Please download the latest version. Just uploaded a new version fixing lots of bugs (including the one you mention).

Thanks for helping to test.

Best regards.


(Luc Pfister) #4

hi, thanks for reply.

With the new version, the first issue was solved, but not the second one. REmoving the code related with "identificationColumn" in extensions/AweCrud/generators/AweCrud/templates/default/_view.php(32) did the trick (but how dirty !)

BTW, I’ve modified the menu array declaration in all the views generators to looks like:




$this->menu=array(

    array('label' =>Yii::t('AweCrud.app', 'List').' '.<?= $this->modelClass ?>::label(2), 'icon'=>'list' ,'url' => array('index')),

    array('label' =>Yii::t('AweCrud.app', 'Create').' <?= $this->modelClass ?>', 'icon'=>'plus' , 'url' => array('create')),

	array('label' =>Yii::t('AweCrud.app', 'Update'), 'icon'=>'pencil','url' => array('update','id' => $model-><?php echo $this->tableSchema->primaryKey; ?>)),

    array('label' =>Yii::t('AweCrud.app', 'Delete'), 'icon'=>'trash', 'url'=>'#', 'linkOptions' => array('submit' => array('delete', 'id' => $model-><?php echo $this->tableSchema->primaryKey; ?>), 'confirm' => Yii::t('AweCrud.app', 'Are you sure you want to delete this item?'))),

    array('label' =>Yii::t('AweCrud.app', 'Manage'), 'icon'=>'list-alt','url' => array('admin')),

);



So it looks good when calling the menu in column2 layout with:




		$this->widget('bootstrap.widgets.TbMenu', array(

			'type'=>'list',

			'items'=>$this->menu,

		));




(Yiqing 95) #5

same problem :

Undefined variable: identificationColumn

:lol:


(Ricobregon) #6

@luc @yiqing95

Fixed in the last version. Thanks for reporting :)


(Luc Pfister) #7

you’re welcome ;)

no kidding now: thank you


(Ricobregon) #8

Feel free to report any bug you find. Thank you too!

;)


(Yiqing 95) #9

Awecms :lol:

this class can’t find


(Ricobregon) #10

Fixing … please take a look in a few minutes at bitbucket… :)


(Ricobregon) #11

New version released. Please check it out!

Feel free to report any bug.


(Daniele Cico) #12

I’m encountering problems in gii AweCrud generator function.

When I click "preview" using a Model generated with AweCrud model function I have this error:

La proprietà "CPhpMessageSource"."extensionPaths" non è definita.

Property "CPhpMessageSource"."extensionPaths" is not defined

I’m up to date at the latest version of AweCrud (24/10 version) and current bootstrap and booster.

Attached you can see the screenshot

Thank you in advance

Daniele


(Daniele Cico) #13

I tried also to remove these lines from configuration:

‘messages’ => array (

	'extensionPaths' =&gt; array(


		'AweCrud' =&gt; 'ext.AweCrud.messages', // AweCrud messages directory.


	),


),

I obtain another error “include(AweCrud.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory” related to, reading the stacktrace, this line:

    &#036;passwordI18n = Yii::t('AweCrud.app', 'password');

(Ricobregon) #14

Oh, right, in the README file you can find the solution…

You need to add in config/main.php file in the "components" section:




    	'messages' => array(

        	// 'class' => 'MessageSource',

        	'extensionPaths' => array(

            	'AweCrud' => 'ext.AweCrud.messages', // AweCrud messages directory.

        	),

    	),




(Ricobregon) #15

Also, please check you are using the last version of Yii… theoretically AweCrud might work on Yii 1.1.9, but I’ve only tested on version 1.1.12.


(Ricobregon) #16

Nevertheless, please download the last version, in order to make sure all the detected bugs also are fixed.


(Daniele Cico) #17

Thank you for the prompt answer.

Still same problems.

I have latest Yii version 1.1.12, latest YiiBooster, latest YiiBoostrap, and your latest 0.6 version of awecrud.

The problems are the same told before, with the messages configuration as in readme:

Property "CPhpMessageSource"."extensionPaths" is not defined

Without:

include(AweCrud.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory" related to, reading the stacktrace, this line:

$passwordI18n = Yii::t(‘AweCrud.app’, ‘password’);

It’s very strange, I also tried to add the app file in italian messages but no results.


(Ricobregon) #18

Just found the reason of the bug.

In order to use i18n in AweCrud is necessary that you upgrade to the latest Yii dev version. Download Last Yii Dev Version


(Daniele Cico) #19

OOK RICARDO thank you.

It works.

Using the developing version of yii and configuring messages as in readme:




        'messages' => array(

                // 'class' => 'MessageSource',

                'extensionPaths' => array(

                'AweCrud' => 'ext.AweCrud.messages', // AweCrud messages directory.

                ),

        ),



Bye,

Daniele


(Ricobregon) #20

If you experience any other issue, please let me know. ;)