Welcome Guest, Not a member yet? Register   Sign In
Why CI doesn't have generators ?
#1

[eluser]jinit13[/eluser]
Hi, I'm coming from Rails background, and I'm wondering why there's no generators in CI ?

Example:

Code:
php script/generate Controller users index register login
It should create a controller named users with views (index, register, login) files ?
#2

[eluser]richthegeek[/eluser]
mostly because creating said files takes 20 seconds and creating a generator would take much longer.

don't be so lazy.
#3

[eluser]jinit13[/eluser]
Well it's pretty helpful as it let's you forget all about naming conventions and creates almost everything for you!

Thanks.
#4

[eluser]adwin[/eluser]
well .. actually you just need to create a file and then type:

Code:
class Xyz extends Controller{

   function Xyz(){
      parrent::Controller();
   }
}
there is no naming conventions .. Smile
so I dont think we need the generator.
But I think ... it would be good idea to create generator for model Big Grin ('that's what I waiting for .. ORM ) Big Grin
#5

[eluser]jinit13[/eluser]
Well parent not parrent LOL
I used Controller in the example, but the generator is supposed to be used for Controllers, Models, .. etc
#6

[eluser]Jamie Rumbelow[/eluser]
I'm sure you could make a few batch files that do the job. If you don't I might give it a go later.
#7

[eluser]xwero[/eluser]
Michael Wales did something quite a while ago but i can't find it at the moment, maybe you have better search capacities.
#8

[eluser]Jamie Rumbelow[/eluser]
No, Michael Wales lost all his old blog posts when he changed his blog.
#9

[eluser]Michael Wales[/eluser]
Yeah I cranked a little one out but with the switch of hosts my blog and all it's data went down. To be honest, I don't intend on recreating it - as others have mentioned it is virtually useless. To create a controller, model, library, view, anything it's only 2-3 lines of code.

I find "snippets" for my favorite text editor to be much more helpful.
#10

[eluser]xwero[/eluser]
Look at that, his blog changed Smile Michael haven't you added the code to the wiki or put in a forum post?
Useless for some is useful for others. You know there are people that think CI is useless Wink

But i agree creating a file and generate the base code using shortcuts is pushing in 6 keys at most a generator can't beat that.




Theme © iAndrew 2016 - Forum software by © MyBB