views:

62

answers:

1

Hi there. I was wondering how, for example, cakePHP can use the terminal/command line to create files and put content in it. I guess they use some kind of template for the content but how do they do it?

I know that you can create controllers and so on with it. Anyone know how it's done?

/ Tobias

EDIT: I've been searching and searching but can't find anything about this. Please is there anyone who can help me with this?

A: 

You can use templates for easy to create files or something like Zend_CodeGenerator for a more elaborate approach. Apart from that, have a look at the sourcecode for CakePHP's bake if you are specifically interested in how they do it.

Gordon
I've been looking at it but I don't really get it, never worked with it before. Is there any tutorials or something out there I can take a look at?
sandelius
Well, there is examples for Zend_CodeGenerator on the page I linked. And for Cake, I am sure they have examples on their pages somewhere.
Gordon