Yii Framework Forum: Code generators - Yii Framework Forum

Jump to content

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

Code generators

#21 User is offline   jacmoe 

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

Posted 26 August 2011 - 09:31 PM

Added a how-to to the wiki:
run-yiic-directly-from-your-app-without-a-shell
"Less noise - more signal"
0

#22 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 29 August 2011 - 08:40 AM

I'm also only using yiic to create webapp and models. As Yii is all about good OOP and reusability i really wonder why it should not be possible to write some code generator that can be used for both, yiic and gii. The only difference i see, is that i don't need a preview feature on the command line.
0

#23 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 29 August 2011 - 04:44 PM

I totally agree with Mike.
There should be a solution which uses the same code for code generation, while one has a web-interface and the other the command line for entering the params.
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#24 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 665
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 30 August 2011 - 11:18 PM

View Postsamdark, on 07 August 2011 - 11:57 AM, said:

Solution
- Same templates for both cli and Gii.
- API to use these templates.
- Gii and cli using API.


Seems a good solution to me.

Gii (or the new generator) could be improved also with more extensibility.
A suggestion is to divide the code generation in two steps for each generated method (eg relations, rules etc). The first step will gather/build the information needed and the second step will assemble (generate) the code.
This allows for a method to hook in between and change or add some information before the code is generated.


View Postjacmoe, on 23 August 2011 - 01:21 PM, said:

I also like Giix instead of Gii.


Thank you very much, but "with" not "instead of". :)


View PostPsih, on 25 August 2011 - 07:20 AM, said:

Have to agree on Giix - it's far better (still has it's issues with the code quality - some undefined variables warnings and other stuff - will be fixing it and providing patches - but the functionality is good ).


Thank you. Some bugs are already fixed in the trunk. Please open tickets for anything strange you see in giix!
0

#25 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 31 August 2011 - 12:51 PM

The biggest disadvantages of the web-based solution are the lack of batch scripting and permission handling.
You always have to adjust the directories, where you want to create the files.
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#26 User is offline   elbek 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 134
  • Joined: 22-July 10
  • Location:MA, USA

Posted 21 January 2012 - 11:55 PM

+1 for GII
Elbek
0

#27 User is offline   mmx 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 64
  • Joined: 20-June 11
  • Location:Virginia Beach, VA USA

Posted 09 February 2012 - 03:29 PM

View Postsamdark, on 07 August 2011 - 11:57 AM, said:

Solution
- Same templates for both cli and Gii.
- API to use these templates.
- Gii and cli using API.


Above would be nice. Ever think of building a special version of yiilite with Gii included for execution out of the framework directory (same level as examples)? Then gii could generate applications.

What about a CConsoleView?
1

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