[ Index ] |
|
Code source de PHPonTrax 2.6.6-svn |
[Code source] [Imprimer] [Statistiques]
File containing the TraxGenerator class (PHP 5)
Copyright: | (c) 2005 John Peterson |
Version: | $Id: trax_generator.php 260 2006-09-02 07:19:54Z john $ |
Poids: | 998 lignes (40 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
TraxGenerator:: (16 méthodes):
__construct()
run()
generate_controller()
generate_mailer()
generate_model()
generate_scaffold()
create_controller()
create_helper()
create_view()
exec()
fix_php_brackets()
controller_help()
model_help()
mailer_help()
scaffold_help()
generator_help()
Classe: TraxGenerator - X-Ref
Generate application files in the Trax work area__construct() X-Ref |
Constructor for the TraxGenerator object Compute and store filesystem paths to the various subdirectories of the Trax work area and the template files used to generate application files |
run() X-Ref |
Parse command line and carry out the command Command line arguments, if any are in $_SERVER['argv'] |
generate_controller($name, $views = "", $scaffolding = false) X-Ref |
Implement "generate controller" command <p>Example:<br><samp>php script/generate.php controller</samp> <i>SomeName</i><br> will generate:</p> <ul> <li>a file <samp>app/controllers/</samp><i>some_name</i><samp>_controller.php</samp><br> containing the class definition<br> <samp>class</samp> <i>SomeName</i><samp>Controller extends ApplicationController {}</samp></li> <li>a file <samp>app/helpers/</samp><i>some_name</i><samp>_helper.php</samp></li> <li>a directory <samp>app/views/</samp><i>some_name</i></li> </ul> <p>Optionally, one or more views can be appended to the command:<br> <samp>php script/generate.php controller</samp> <i>SomeName view1 view2</i><br> which will additionally generate files:<br> <samp>app/views/</samp><i>some_name/view1</i><samp>.phtml</samp><br> <samp>app/views/</samp><i>some_name/view2</i><samp>.phtml</samp></p> param: string $name Name in CamelCase of the controller to generate. param: string $views Optional list of views to generate param: boolean $scaffolding |
generate_mailer($name, $views = "") X-Ref |
Pas de description |
generate_model($name) X-Ref |
Implement the "generate model" command <p>Example:<br><samp>php script/generate.php model</samp> <i>SomeName</i><br> will generate a file <samp>app/models/</samp><i>some_name</i><samp>.php</samp><br> containing the class definition<br> <samp>class</samp> <i>SomeName</i> <samp>extends ActiveRecord {}</samp> param: string $name Name of the model. May be in either |
generate_scaffold($model_name, $controller_name, $views="") X-Ref |
Implement the "generate scaffold" command param: string $model_name param: string $controller_name param: string $views |
create_controller($controller,$views="") X-Ref |
Create a controller file with optional view methods param: string $controller Name of the controller param: string[] $views Name(s) of view(s), if any |
create_helper($controller) X-Ref |
Create a helper file for a controller param: string $controller Name of the controller |
create_view($view, $controller) X-Ref |
Create a view file if it doesn't exist Create a view file in the Trax work area if the required file does not yet exist. Generate the view file contents by customizing the view template file with information about the controller and view names. param: string $view Name of the view param: string $controller Name of the controller |
exec($cmd) X-Ref |
Execute an operating system command param: string $cmd Command to be executed |
fix_php_brackets($string) X-Ref |
Replace "< ?php ... ? >" with "<?php ... ?>" param: string $string String to be edited return: string Edited input string |
controller_help() X-Ref |
Output console help message for "generate controller" |
model_help() X-Ref |
Output console help message for "generate model" |
mailer_help() X-Ref |
Output console help message for "generate mailer" |
scaffold_help() X-Ref |
Output console help message for "generate scaffold" |
generator_help() X-Ref |
Output console help message for unrecognized command |
Généré le : Sun Feb 25 20:04:38 2007 | par Balluche grâce à PHPXref 0.7 |