Yii Framework Forum: e-xgen extjs scafolding for admin - Yii Framework Forum

Jump to content

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

e-xgen extjs scafolding for admin extjs scafolding gii template based on giix extension by mentel Rate Topic: ***-- 3 Votes

#1 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 07 November 2011 - 02:47 AM

Dear yii-ers,

e-xgen is giix Extjs Generator, an Extjs code generator for Yii PHP framework.

e-xgen is inspired and based on giix by mentel, gii-template-collection (gtc), by Herbert Maschke (thyseus), and additional webapp theme from derelict.

Acknowledgements

e-xgen is inspired and uses code from giix, Yii PHP framework and gii-template-collection, i only add some function to generate extjs crud template(i'm trying to make the template as simple as possible, so input are welcome). Many thanks to Qiang Xue, Mentel ,Herbert Maschke, derelict and the contributors of these software.

features from e-xgen :
  • generate extjs store from table definition
  • generate extjs grid and column header, and basic create, update and delete control
  • generate extjs form based on table definition (including combo for foreign key contraint) and basic create update operation.
  • additional webapptheme (but with giix foreign key support)



Features from giix:

giix extends Yii's gii by providing:

  • Proper handling of related model attributes, rendering appropriate form fields based on relation type.
  • More support for HAS_MANY and MANY_MANY relations.
  • Native support for saving MANY_MANY relations with the new method GxActiveRecord::saveWithRelated.
  • Native support for saving multiple (related or not) records with the new method GxActiveRecord::saveMultiple.
  • Automatic string representation for a model via GxActiveRecord::representingColumn() and GxActiveRecord::__toString().
  • Better i18n support and easier to maintain: support to active record labels. You change the label once in the model and it is automatically updated in the views. This is especially useful for plurals.
  • Out-of-the box i18n support by using Yii::t().
  • Appropriate form fields are rendered based on model attribute/table field data type.
  • Separated model and basemodel. Basemodel can be regenerated without overwriting your code in the model.
  • Smart methods can query your database for just the needed data (usually the primary key and the field with the string representantion), avoiding manual setup or a "select *".
  • Extensive use of default method parameters. Appropriate data is found automatically.
  • Some (incipient) support for tables with composite primary keys.
  • Generated code is completely free from styling and formatting. Your CSS controls the presentation.
  • Generated code is (almost) free of comments.
  • Well documented and commented source code. Ohloh says that 40% of the lines in the code are comments! You can understand and modify anything you want.


e-xgen extension link
github link
Attached File  screensyur.png (27.6K)
Number of downloads: 290
Attached File  screensyur2.png (16.87K)
Number of downloads: 257

i'm a yii newbie, i will learn alot from your input and recomendation

thx alot

june
The Night Has Come to Hold Us Young - SmP
0

#2 User is offline   jellydn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 24-April 11

Posted 08 November 2011 - 08:51 AM

Thanks a lot about your extension. Can you give a demo or how to use this extension in demo yii with extjs ?
0

#3 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 09 November 2011 - 02:47 AM

View Postjellydn, on 08 November 2011 - 08:51 AM, said:

Thanks a lot about your extension. Can you give a demo or how to use this extension in demo yii with extjs ?

i have allready setup a demo and a custom webapp command to make it easier to start, but i'm still busy at this time, i'm planning to upload it this weekend

thanks
The Night Has Come to Hold Us Young - SmP
0

#4 User is offline   jowee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 28-October 11
  • Location:Russia, Kursk

Posted 16 November 2011 - 08:16 AM

View Posthening malam, on 09 November 2011 - 02:47 AM, said:

i have allready setup a demo and a custom webapp command to make it easier to start, but i'm still busy at this time, i'm planning to upload it this weekend

thanks



Hi! I try to create CRUD operation through GiixCrudjs Generator but I receive an exception "CWebApplication and its behaviors do not have a method or closure named "getName"."
1

#5 User is offline   inluxc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-May 09

Posted 17 November 2011 - 07:03 PM

View Postjowee, on 16 November 2011 - 08:16 AM, said:

Hi! I try to create CRUD operation through GiixCrudjs Generator but I receive an exception "CWebApplication and its behaviors do not have a method or closure named "getName"."



Yep, i have the same problem.
0

#6 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 17 November 2011 - 10:03 PM

View Postinluxc, on 17 November 2011 - 07:03 PM, said:

Yep, i have the same problem.


ok i'll check it out sorry for late reply, btw can you tell me step to produce that problem?
The Night Has Come to Hold Us Young - SmP
0

#7 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 17 November 2011 - 10:32 PM

View Postinluxc, on 17 November 2011 - 07:03 PM, said:

Yep, i have the same problem.


@inluxc and @jowee

ok found it, try create a module first before generating the crud js, after that create a model with giix model and controller with giixcrudjs under that module,

please read the requirement in e-xgen extension page

thx for trying my extension
The Night Has Come to Hold Us Young - SmP
0

#8 User is offline   inluxc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-May 09

Posted 19 November 2011 - 04:21 AM

I did create an Modules.

heres the data im inserting:

Model Class
application.modules.admin.models.Users

Controller ID
admin/users


The models exists and de module too.

View Posthening malam, on 17 November 2011 - 10:32 PM, said:

@inluxc and @jowee

ok found it, try create a module first before generating the crud js, after that create a model with giix model and controller with giixcrudjs under that module,

please read the requirement in e-xgen extension page

thx for trying my extension


UPDATE:

Ok i figured out, we have to activate the module in the configuration.
0

#9 User is offline   inluxc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-May 09

Posted 19 November 2011 - 06:31 AM

Sorry, i have another problem, i can get the side bar to load the itens from site/tree/
0

#10 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 19 November 2011 - 08:42 PM

View Postinluxc, on 19 November 2011 - 06:31 AM, said:

Sorry, i have another problem, i can get the side bar to load the itens from site/tree/

To get the sidebar load the item, you have to manualy add it to the site controller, on action tree add your previously generated crud with pattern jun."Your model name"Grid, btw I will add edit config after create module base on your input, once again thx for trying my ext
The Night Has Come to Hold Us Young - SmP
0

#11 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 01 December 2011 - 09:34 PM

View Postmightymike, on 01 December 2011 - 09:29 PM, said:

im having the same problem running the GiixCrudjs Generator.

CException CWebApplication and its behaviors do not have a method or closure named "getName".
can anyone help me on how to solve this


after creating the module, add the module to the config file before running GiixCrudjs.. thx for trying the extension.., any input are welcome..
The Night Has Come to Hold Us Young - SmP
0

#12 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 01 December 2011 - 09:40 PM

extension page updated on usage section, thx for all, sorry for the delay
The Night Has Come to Hold Us Young - SmP
1

#13 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 01 December 2011 - 09:41 PM

Moderator note:
Just wanted to add that MightyMike has been flagged as a spammer as his reply was a direct word by word copy and paste of a previous post in this topic.. In case you were wondering where the post went. ;)
"Less noise - more signal"
0

#14 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 01 December 2011 - 09:50 PM

View Postjacmoe, on 01 December 2011 - 09:41 PM, said:

Moderator note:
Just wanted to add that MightyMike has been flagged as a spammer as his reply was a direct word by word copy and paste of a previous post in this topic.. In case you were wondering where the post went. ;)

thanks, i was wondering indeed.. i reply quickly after notification, without read the post first, i didn't notice it has exact same word as previous post :)
The Night Has Come to Hold Us Young - SmP
0

#15 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 06 December 2011 - 11:11 PM

finally get yii working on heroku, stil setting up postgress in heroku, hope i can make the example up and running for today, btw this is the example link http://exgen.herokua....php/site/login, heroku doesn't allow htaccess so bye bye pretty url :(
The Night Has Come to Hold Us Young - SmP
0

#16 User is offline   Denn1s 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-November 11

Posted 18 January 2012 - 09:10 PM

Hello, I'm trying version 0.2 of the extension, and I'm really exited to get this working :)

I found it a little hard to get this running so I would like to share my procedure to help anyone else who stumbles here:

First install as described in the extension page, extract zip and place js folder in root, themes folder content in themes, and the other folders in protected/extensions. Enable gii as instructed and add to the imports array 'ext.giix-components.*'

After installed, you should see in gii a couple new options.

* Change anything in italics to something you like

1. Create a Module using gii's Module generator and name it mymodule
2. Enable said module in config/main.php: 'modules'=>array('mymodule', ... )
3. Create a mymodel Model using giix Model Generator (in gii) where you must set module path to: application.modules.mymodule.models
4. Use the GiixCrudjs Generator with model class: application.modules.mymodule.models.mymodel and Controller ID: mymodule/mymodel . All other settings as default. Remember to change the theme in main.php to make full use of extJS.

Still not newbie friendly but hey, four easy steps :)

Keep up with this extension! It saved my life on a almost dead project.
0

#17 User is offline   darkcom 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-February 12

Posted 05 February 2012 - 08:51 AM

"add generated controler to site/tree action, with pattern 'jun.' + model name + 'Grid', automatic site/tree action will be added in the next release"

could you please give me a sample about "site/tree" action file.
0

#18 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 13 February 2012 - 06:22 AM

View PostDenn1s, on 18 January 2012 - 09:10 PM, said:

Hello, I'm trying version 0.2 of the extension, and I'm really exited to get this working :)

I found it a little hard to get this running so I would like to share my procedure to help anyone else who stumbles here:

First install as described in the extension page, extract zip and place js folder in root, themes folder content in themes, and the other folders in protected/extensions. Enable gii as instructed and add to the imports array 'ext.giix-components.*'

After installed, you should see in gii a couple new options.

* Change anything in italics to something you like

1. Create a Module using gii's Module generator and name it mymodule
2. Enable said module in config/main.php: 'modules'=>array('mymodule', ... )
3. Create a mymodel Model using giix Model Generator (in gii) where you must set module path to: application.modules.mymodule.models
4. Use the GiixCrudjs Generator with model class: application.modules.mymodule.models.mymodel and Controller ID: mymodule/mymodel . All other settings as default. Remember to change the theme in main.php to make full use of extJS.

Still not newbie friendly but hey, four easy steps :)

Keep up with this extension! It saved my life on a almost dead project.


hallo maaf baru baca thx untuk tambahan metode nya, please rate it, karena aga susah install nya ada yg ngasih rate negative.. :( thx hatur nuhun sebelumnya
The Night Has Come to Hold Us Young - SmP
0

#19 User is offline   hening malam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 10-October 10

Posted 13 February 2012 - 06:36 AM

View Postdarkcom, on 05 February 2012 - 08:51 AM, said:

"add generated controler to site/tree action, with pattern 'jun.' + model name + 'Grid', automatic site/tree action will be added in the next release"

could you please give me a sample about "site/tree" action file.


aku udah di reply di forum indo :) thx for using it
The Night Has Come to Hold Us Young - SmP
0

#20 User is offline   banago 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 10-March 11
  • Location:Piz da Dufour

Posted 20 February 2012 - 07:29 AM

Hi,
I've installed the e-xgen extension and it works well.
BTW - in my setup I had to use the following in config/main.php to make it work (and to allow the use of gii)
'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(

				'gii'=>'gii',
				'gii/<controller:\w+>'=>'gii/<controller>',
				'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		


I'm still a yii and extjs newbie and maybe you could answer me some questions:

I have the tables "Master" and a model "Detail" for which generated the code with GiixModel and GiixCrudjs Generator.
This works so far.
Now I have added the extjs code from the grid "Detail" to the form "Master".
The Detail grid is now displayed in the Master Form.
Now the tricky part...

I'm trying now to filter the Detail-grid in the Master-form to the records which belong to the masterform...

So I've changed the code in the DetailController to display only some records.

$model = Faktpos::model()->findAll($criteria);
to
$id=426;
$model = Detail::model()->with('Master')->findAll('MasterID=' . $id)


Question(s):
  • How shall I pass the id of the master record to the detail controller?
  • What do you use for debugging such issues? (How can I see what Yii is doing if I'm clicking on something on the extjs Gui?)
  • Or is there a simpler / better approach?

0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • 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