CodeIgniter Forums
Code generation from the cmd? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Code generation from the cmd? (/showthread.php?tid=19456)



Code generation from the cmd? - El Forum - 06-08-2009

[eluser]demogar[/eluser]
Hey there!

I would like to know if there's any code generation tool available to use in the cmd like "bake" in CakePHP.

I took a look at CodeCrafter but it's web based, I would like to type in my consolo something like "codeigniter make view" or something similar to this and make the view file with basic structure.

I'm just curious about this because I've used something similar before in CakePHP and ROR.

Thank you in advance! Smile


Code generation from the cmd? - El Forum - 06-08-2009

[eluser]Phil Sturgeon[/eluser]
Yea we have that already.

Quote:echo "<?php ?>" > application/views/viewname.php

It's a really clever systax actually, just like using *nix's "baked in" default commands! ;-)


Code generation from the cmd? - El Forum - 06-08-2009

[eluser]jedd[/eluser]
Hi Demostenes,

I've not used Cake, or indeed RoR for very long, but did look at CodeCrafter a while ago - that was more centred around creating a basic CRUD framework - so the model side of the fence. What kind of view templates were you anticipating being generated? The table (which I tend to avoid) and form and other classes will help you generate view snippets pretty easily. I think much of this stuff is so dependent on the particular project that it would be tricky, almost pointless, trying to come up with a cookie cutter code generator - but I could be wrong. Most of my stuff is cut-and-pasted from previous works (or from posts on these forums) but again this is heavily reliant on personal, and consequently very subjective, criteria.


Code generation from the cmd? - El Forum - 06-08-2009

[eluser]demogar[/eluser]
Well, I was asking it being curious, because I can make the code generation with e-text editor (textmate for windows) but it's a good idea to have a try on this like in django, cake and ror


Code generation from the cmd? - El Forum - 06-20-2009

[eluser]Phil Sturgeon[/eluser]
Huh, well looks like one already exists.

cake

Quote:cake is a generator to CodeIgniter Framework.

You can use to generate your controllers and models. When you create controllers, cake will create views and add routes to your controller.