Changeset 195 for trunk/trax/vendor/trax/trax_generator.php
- Timestamp:
- 04/03/06 16:27:26 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/trax_generator.php (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/trax_generator.php
r170 r195 27 27 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 28 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 * 30 * @package PHPonTrax 29 31 */ 30 32 31 33 /** 32 * Implement the commands of {@link generate.php script/generate.php}34 * Generate application files in the Trax work area 33 35 * 36 * Implements the commands of {@link generate.php script/generate.php} 34 37 * <p>Legal commands:</p> 35 38 * <ul> … … 38 41 * <li>{@link generate_scaffold() scaffold}</li> 39 42 * </ul> 40 *41 * @package PHPonTrax42 43 */ 43 44 class TraxGenerator { 44 45 45 private 46 $view_path, 47 $controller_path, 48 $helper_path, 49 $model_path, 50 $mkdir_cmd, 51 $controller_template_file, 52 $helper_template_file, 53 $view_template_file, 54 $model_template_file, 55 $scaffold_template_path, 56 $layout_path, 57 $layout_filename; 58 public 59 $view_file_extention = TRAX_VIEWS_EXTENTION; 46 /** 47 * Filesystem path to the app/views directory in the Trax work area 48 * @var string 49 */ 50 private $view_path; 51 52 /** 53 * Filesystem path to the app/controllers directory in the Trax work area 54 * @var string 55 */ 56 private $controller_path; 57 58 /** 59 * Filesystem path to the app/helpers directory in the Trax work area 60 * @var string 61 */ 62 private $helper_path; 63 64 /** 65 * Filesystem path to the app/model directory in the Trax work area 66 * @var string 67 */ 68 private $model_path; 69 70 /** 71 * Generated subdirectories in the Trax work area 72 * 73 * When a controller is generated with a name that includes '/', 74 * $extra_path is set to the implied subdirectories. 75 * @var string 76 */ 77 private $extra_path; 78 79 /** 80 * Platform-dependent command to make a directory 81 * @var string 82 */ 83 private $mkdir_cmd; 84 85 /** 86 * Filesystem path to the templates/controller.php file 87 * @var string 88 */ 89 private $controller_template_file; 90 91 /** 92 * Filesystem path to the templates/helper.php file 93 * @var string 94 */ 95 private $helper_template_file; 96 97 /** 98 * Filesystem path to the templates/view.phtml file 99 * @var string 100 */ 101 private $view_template_file; 102 103 /** 104 * Filesystem path to the templates/model.php file 105 * @var string 106 */ 107 private $model_template_file; 108 109 /** 110 * Filesystem path to templates/scaffolds/generator_templates directory 111 * @var string 112 */ 113 private $scaffold_template_path; 114 115 /** 116 * Filesystem path to the app/views/layouts/ directory in the 117 * Trax work area 118 * @var string 119 */ 120 private $layouts_path; 121 122 /** 123 * @todo Document this variable 124 * 125 * Value is set by {@link generate_controller()} and used by 126 * {@link generate_scaffold()} 127 * @var string 128 */ 129 private $layout_filename; 130 131 /** 132 * CamelCase name of the controller class 133 * @var string 134 */ 135 private $controller_class; 136 137 /** 138 * Value of the view files extension (usually '.phtml') 139 * @var string 140 */ 141 public $view_file_extention = TRAX_VIEWS_EXTENTION; 60 142 61 143 /** 62 144 * Constructor for the TraxGenerator object 63 145 * 146 * Compute and store filesystem paths to the various 147 * subdirectories of the Trax work area and the template files 148 * used to generate application files 64 149 * @uses $GLOBALS['TRAX_INCLUDES'] 65 150 * @global string[] $GLOBALS['TRAX_INCLUDES'] Array of paths to 66 151 * various Trax directories 152 * @uses controller_path 153 * @uses controller_template_file 154 * @uses helper_path 155 * @uses helper_template_file 156 * @uses layouts_path 157 * @uses model_path 158 * @uses model_template_file 159 * @uses scaffold_template_path 160 * @uses view_path 161 * @uses view_template_file 67 162 */ 68 163 function __construct() { 69 $this->view_path = TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['views']; 70 $this->controller_path = TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['controllers']; 71 $this->helper_path = TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['helpers']; 72 $this->model_path = TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['models']; 73 $this->layouts_path = TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['layouts']; 74 $this->controller_template_file = TRAX_LIB_ROOT . "/templates/controller.php"; 75 $this->helper_template_file = TRAX_LIB_ROOT . "/templates/helper.php"; 76 $this->view_template_file = TRAX_LIB_ROOT . "/templates/view.".$this->view_file_extention; 77 $this->model_template_file = TRAX_LIB_ROOT . "/templates/model.php"; 78 $this->scaffold_template_path = TRAX_LIB_ROOT . "/templates/scaffolds/generator_templates"; 164 $this->view_path = 165 TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['views']; 166 $this->controller_path = 167 TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['controllers']; 168 $this->helper_path = 169 TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['helpers']; 170 $this->model_path = 171 TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['models']; 172 $this->layouts_path = 173 TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['layouts']; 174 $this->controller_template_file = 175 TRAX_LIB_ROOT . "/templates/controller.php"; 176 $this->helper_template_file = 177 TRAX_LIB_ROOT . "/templates/helper.php"; 178 $this->view_template_file = 179 TRAX_LIB_ROOT . "/templates/view.".$this->view_file_extention; 180 $this->model_template_file = 181 TRAX_LIB_ROOT . "/templates/model.php"; 182 $this->scaffold_template_path = 183 TRAX_LIB_ROOT . "/templates/scaffolds/generator_templates"; 79 184 80 185 if (substr(PHP_OS, 0, 3) == 'WIN') { … … 83 188 $this->mkdir_cmd = "mkdir -p"; 84 189 } 85 86 190 } 87 191 88 192 /** 89 193 * Parse command line and carry out the command 90 * @todo Document this method 194 * 195 * Command line arguments, if any are in $_SERVER['argv'] 196 * @uses controller_help() 197 * @uses generate_controller() 198 * @uses generate_model() 199 * @uses generate_scaffold() 200 * @uses generator_help() 201 * @uses model_help() 202 * @uses scaffold_help() 91 203 */ 92 204 function run() { 93 $command = strtolower($_SERVER["argv"][1]); 94 $command_name = $_SERVER["argv"][2]; 95 205 206 // If command line arguments exist, parse them 207 if (array_key_exists('argv', $_SERVER)) { 208 if (array_key_exists(1, $_SERVER['argv'])) { 209 $command = strtolower($_SERVER["argv"][1]); 210 } 211 if (array_key_exists(2, $_SERVER['argv'])) { 212 $command_name = $_SERVER["argv"][2]; 213 } 214 } 215 216 // Execute command or output a diagnostic 96 217 if(empty($command)) { 97 218 $this->generator_help(); 98 219 } else { 99 220 switch($command) { 221 222 // Process "controller" command 100 223 case "controller": 101 224 if(empty($command_name)) { 102 225 $this->controller_help(); 103 226 } else { 104 if($_SERVER["argv"][3] != "") { 227 $views = array(); 228 if(array_key_exists(3, $_SERVER['argv']) 229 && ($_SERVER["argv"][3] != "")) { 105 230 for($i=3;$i < count($_SERVER["argv"]);$i++) { 106 $views[] = strtolower($_SERVER["argv"][$i]);231 $views[] = strtolower($_SERVER["argv"][$i]); 107 232 } 108 233 } … … 110 235 } 111 236 break; 237 238 // Process "model" command 239 // $command_name is the name of the model 112 240 case "model": 113 241 if(empty($command_name)) { … … 117 245 } 118 246 break; 247 248 // Process "scaffold" command 249 // $command_name has the name of the model 250 // $_SERVER['argv'][3] has the name of the controller 119 251 case "scaffold": 120 if(empty($command_name)) { 252 253 // Model name is required 254 if( empty($command_name) ) { 255 echo "Error: name of model omitted\n"; 121 256 $this->scaffold_help(); 257 break; 258 } 259 260 // Controller name is optional 261 if (array_key_exists(3, $_SERVER["argv"])) { 262 $controller_name = $_SERVER["argv"][3]; 122 263 } else { 123 $controller_name = $_SERVER["argv"][3]; 124 if($_SERVER["argv"][4] != "") { 125 for($i=4;$i < count($_SERVER["argv"]);$i++) { 126 $views[] = strtolower($_SERVER["argv"][$i]); 127 } 128 } 129 $this->generate_scaffold($command_name, $controller_name, $views); 264 $controller_name = null; 130 265 } 266 267 // Views are optional following controller name 268 $views = array(); 269 if (array_key_exists(4, $_SERVER["argv"]) 270 && ($_SERVER["argv"][4] != "")) { 271 for($i=4;$i < count($_SERVER["argv"]);$i++) { 272 $views[] = strtolower($_SERVER["argv"][$i]); 273 } 274 } 275 $this->generate_scaffold($command_name, 276 $controller_name, $views); 131 277 break; 132 } 133 } 134 exit; 278 279 default: 280 $this->generator_help(); 281 } // switch($command) 282 } 283 return; 135 284 } 136 285 … … 160 309 * <samp>app/views/</samp><i>some_name/view2</i><samp>.phtml</samp></p> 161 310 * 162 * @param string $name Name of the controller to generate in camel case 311 * @param string $name Name in CamelCase of the controller to generate. 312 * The value may include '/' which will cause 313 * creation of subdirectories indicated to 314 * hold the controller and view files. 163 315 * @param string $views Optional list of views to generate 164 316 * @param boolean $scaffolding 317 * @uses Inflector::underscore() 318 * @uses $controller_class Set during call 319 * @uses $controller_path Must be set before call. 320 * @uses create_controller() 321 * @uses create_helper() 322 * @uses create_view() 323 * @uses $extra_path Set during call 324 * @uses $helper_path Must be set before call. 325 * @uses $layouts_path Must be set before call. 326 * @uses $layout_filename Set during call 327 * @uses $view_path Must be set before call. 165 328 */ 166 329 function generate_controller($name, $views="", $scaffolding = false) { … … 225 388 * <samp>class</samp> <i>SomeName</i> <samp>extends 226 389 * ActiveRecord {}</samp> 227 * @param string $name Name of the model 390 * @param string $name Name of the model. May be in either 391 * under_score or CamelCase. If no '_' exists in 392 * $name it is treated as CamelCase. 393 * @uses Inflector::underscore() 394 * @uses model_path Must be set before call. 395 * Not changed during call. 396 * @uses model_template_file Must be set before call. 397 * Not changed during call. 228 398 */ 229 399 function generate_model($name) { … … 263 433 * @param string $controller_name 264 434 * @param string $views 435 * @uses generate_controller() 436 * @uses generate_model() 437 * @uses Inflector::classify() 438 * @uses Inflector::humanize() 439 * @uses Inflector::pluralize() 440 * @uses Inflector::singularize() 441 * @uses Inflector::underscore() 442 * @uses $layout_filename Set as output from 443 * generate_controller(). 444 * Not changed afterward. 445 * @uses fix_php_brackets() 265 446 */ 266 447 function generate_scaffold($model_name, $controller_name, $views="") { 267 448 if(!$model_exists = $this->generate_model($model_name)) { 268 449 echo "Error - Can't create Model: $model_name.\n"; 269 exit;450 return; 270 451 } 271 452 … … 275 456 $plural_model_name = Inflector::pluralize($model_name); 276 457 $human_model_name = Inflector::humanize($model_name); 458 277 459 $this->{$singluar_model_name} = new $model_class_name(); 278 if( !$controller_name) {279 $controller_name = Inflector:: pluralize($model_name);460 if(empty($controller_name)) { 461 $controller_name = Inflector::underscore($model_name); 280 462 } else { 281 463 $controller_name = Inflector::underscore($controller_name); 282 464 } 283 $controller_file = "$this->controller_path/".$controller_name."_controller.php"; 465 $GLOBALS['current_controller_name'] = $controller_name; 466 $controller_file = 467 "$this->controller_path/" . $controller_name."_controller.php"; 468 $GLOBALS['current_controller_path'] = $controller_file; 284 469 $non_scaffolded_actions = array(); 285 470 $illegal_views = array("index","add","edit","show"); … … 291 476 } 292 477 } 293 $this->generate_controller($controller_name, $non_scaffolded_actions, true); 478 $this->generate_controller($controller_name, 479 $non_scaffolded_actions, true); 294 480 if(stristr($controller_name, "/")) { 295 $controller_class_name = Inflector::classify(substr($controller_name,strrpos($controller_name, "/")+1)); 296 $human_controller_name = Inflector::humanize(substr($controller_name,strrpos($controller_name, "/")+1)); 481 $controller_class_name = 482 Inflector::classify(substr($controller_name, 483 strrpos($controller_name, "/")+1)); 484 $human_controller_name = 485 Inflector::humanize(substr($controller_name, 486 strrpos($controller_name, "/")+1)); 297 487 } else { 298 488 $controller_class_name = Inflector::classify($controller_name); … … 416 606 417 607 /** 418 * @todo Document this method 419 * 608 * Create a controller file with optional view methods 609 * 610 * @param string $controller Name of the controller 611 * @param string[] $views Name(s) of view(s), if any 612 * @uses controller_class Must be set before call. 613 * Not changed during call. 614 * @uses controller_path Must be set before call. 615 * Not changed during call. 616 * @uses controller_template_file Must be set before call. 617 * Not changed during call. 618 * @todo Should return succeed/fail indication 420 619 */ 421 620 function create_controller($controller,$views="") { 422 621 423 $controller_file = "$this->controller_path/".$controller."_controller.php"; 622 $controller_file = "$this->controller_path/" 623 . $controller . "_controller.php"; 424 624 425 625 if(!file_exists($controller_file)) { 426 626 if(file_exists($this->controller_template_file)) { 427 627 $template = file_get_contents($this->controller_template_file); 428 $template = str_replace('[class_name]',$this->controller_class,$template); 429 if(is_array($views)) { 430 foreach($views as $view) { 431 $classMethods[] = "\tfunction $view() {\n\t}"; 628 $template = str_replace('[class_name]', 629 $this->controller_class,$template); 630 // Add view methods 631 if (!empty($views)) { 632 633 // There are some views, add a method for each 634 if(is_array($views)) { 635 636 // Multiple views in an array 637 foreach($views as $view) { 638 $classMethods[] = "\tfunction $view() {\n\t}"; 639 } 640 $classMethods = implode("\n\n",$classMethods); 641 } else { 642 $classMethods = "\tfunction $views() {\n\t}\n\n"; 432 643 } 433 $classMethods = implode("\n\n",$classMethods); 644 $template = str_replace('[class_methods]', 645 $classMethods,$template); 646 } else { 647 648 // No view methods to add, so remove unneeded template 649 $template = str_replace('[class_methods]', '',$template); 434 650 } 435 $template = str_replace('[class_methods]',$classMethods,$template);436 651 437 652 if(!file_put_contents($controller_file,$template)) { 438 echo "error creating controller class file: $controller_file\n"; 653 echo "error creating controller class file: " 654 . $controller_file . "\n"; 439 655 } else { 440 656 echo "created $controller_file\n"; … … 442 658 443 659 } else { 444 echo "error controller template file doesn't exist: $this->controller_template_file\n"; 660 echo "error controller template file doesn't exist: " 661 . $this->controller_template_file . "\n"; 445 662 } 446 663 } else { … … 450 667 451 668 /** 452 * @todo Document this method 453 * 669 * Create a helper file for a controller 670 * 671 * @param string $controller Name of the controller 672 * @uses controller_class Must be set before call. 673 * Not changed during call. 674 * @uses helper_path Must be set before call. 675 * Not changed during call. 676 * @uses helper_template_file Must be set before call. 677 * Not changed during call. 678 * @todo Should return succeed/fail indication 454 679 */ 455 680 function create_helper($controller) { 456 457 681 $helper_file = "$this->helper_path/".$controller."_helper.php"; 458 459 682 if(!file_exists($helper_file)) { 460 683 if(file_exists($this->helper_template_file)) { 461 684 $template = file_get_contents($this->helper_template_file); 462 $template = str_replace('[class_name]',$this->controller_class,$template); 685 $template = str_replace('[class_name]', 686 $this->controller_class,$template); 463 687 if(!file_put_contents($helper_file,$template)) { 464 688 echo "error creating helper file: $helper_file\n"; … … 468 692 469 693 } else { 470 echo "error helper template file doesn't exist: $this->helper_template_file\n"; 694 echo "error helper template file doesn't exist: " 695 . $this->helper_template_file . "\n"; 471 696 } 472 697 } else { … … 476 701 477 702 /** 478 * @todo Document this method 479 * 703 * Create a view file if it doesn't exist 704 * 705 * Create a view file in the Trax work area if the required file 706 * does not yet exist. Generate the view file contents by 707 * customizing the view template file with information about the 708 * controller and view names. 709 * 710 * @param string $view Name of the view 711 * @param string $controller Name of the controller 712 * @uses controller_class Must be set before call. 713 * Not changed during call. 714 * @uses view_file_extension Must be set before call. 715 * Not changed during call. 716 * @uses view_path Must be set before call. 717 * Not changed during call. 718 * @uses view_template_file Must be set before call. 719 * Not changed during call. 720 * @todo Should return succeed/fail indication 480 721 */ 481 722 function create_view($view, $controller) { … … 484 725 if(file_exists($this->view_template_file)) { 485 726 $template = file_get_contents($this->view_template_file); 486 $template = str_replace('[class_name]',$this->controller_class,$template); 727 $template = str_replace('[class_name]', 728 $this->controller_class,$template); 487 729 $template = str_replace('[controller]',$controller,$template); 488 730 $template = str_replace('[view]',$view,$template); … … 493 735 } 494 736 } else { 495 echo "error controller template file doesn't exist: $this->view_template_file\n"; 737 echo "error view template file doesn't exist: " 738 . $this->view_template_file . "\n"; 496 739 } 497 740 } else { … … 504 747 * 505 748 * @param string $cmd Command to be executed 749 * @todo Replace with calls to filesystem methods 506 750 */ 507 751 function exec($cmd) { … … 520 764 */ 521 765 function fix_php_brackets($string) { 522 return str_replace("? >", "?>", str_replace("< ?php", "<?php", $string)); 766 return str_replace("? >", "?>", 767 str_replace("< ?php", "<?php", $string)); 523 768 } 524 769 … … 527 772 */ 528 773 function controller_help() { 529 echo "Usage: ./generate.php controller ControllerName [view1 view2 ...]\n\n";774 echo "Usage: php generate.php controller ControllerName [view1 view2 ...]\n\n"; 530 775 echo "Description:\n"; 531 echo "\tThe controller generator creates functions for a new controller and its views.\n\n"; 776 echo "\tThe controller generator creates functions for a new controller and\n"; 777 echo"\tits views.\n\n"; 532 778 echo "\tThe generator takes a controller name and a list of views as arguments.\n"; 533 779 echo "\tThe controller name may be given in CamelCase or under_score and should\n"; … … 537 783 echo "\ttemplates in app/views/controller_name.\n\n"; 538 784 echo "Example:\n"; 539 echo "\t ./script/generate.php controller CreditCard open debit credit close\n\n";785 echo "\tphp script/generate.php controller CreditCard open debit credit close\n\n"; 540 786 echo "\tCredit card controller with URLs like /credit_card/debit.\n"; 541 787 echo "\t\tController: app/controllers/credit_card_controller.php\n"; … … 543 789 echo "\t\tHelper: app/helpers/credit_card_helper.php\n\n"; 544 790 echo "Module/Folders Example:\n"; 545 echo "\t ./script/generate.php controller 'admin/credit_card' suspend late_fee\n\n";791 echo "\tphp script/generate.php controller 'admin/credit_card' suspend late_fee\n\n"; 546 792 echo "\tCredit card admin controller with URLs /admin/credit_card/suspend.\n"; 547 793 echo "\t\tController: app/controllers/admin/credit_card_controller.php\n"; … … 554 800 */ 555 801 function model_help() { 556 echo "Usage: ./generate.php model ModelName\n";802 echo "Usage: php generate.php model ModelName\n"; 557 803 echo "Description:\n"; 558 804 echo "\tThe model generator creates functions for a new model.\n"; 559 echo "\tThe generator takes a model name as its argument. The model name may be\n";560 echo "\t given in CamelCase or under_score and should not be suffixed with 'Model'.\n";561 echo "\t The generator creates a model class in app/models.\n";805 echo "\tThe generator takes a model name as its argument. The model name\n"; 806 echo "\tmay be given in CamelCase or under_score and should not be suffixed\n"; 807 echo "\twith 'Model'. The generator creates a model class in app/models.\n"; 562 808 echo "Example:\n"; 563 echo "\t ./script/generate.php model Account\n";809 echo "\tphp script/generate.php model Account\n"; 564 810 echo "\tThis will create an Account model:\n"; 565 811 echo "\t\tModel: app/models/account.php\n\n"; … … 570 816 */ 571 817 function scaffold_help() { 572 echo "Usage: ./generate.php scaffold ModelName [ControllerName] [view1 view2 ...]\n\n";818 echo "Usage: php script/generate.php scaffold ModelName [ControllerName] [view1 view2 ...]\n\n"; 573 819 echo "Description:\n"; 574 820 echo "\tThe scaffold generator creates a controller to interact with a model.\n"; 575 echo "\tIf the model does not exist, it creates the model as well. The generated\n"; 576 echo "\tcode is equivalent to the ( public \$scaffold = \"model\"; ) declaration,\n"; 577 echo "\tmaking it easy to migrate when you wish to customize your controller and views.\n\n"; 821 echo "\tIf the model does not exist, it creates the model as well. The\n"; 822 echo "\tgenerated code is equivalent to the ( public \$scaffold = \"model\"; )\n"; 823 echo "\tdeclaration, making it easy to migrate when you wish to customize\n"; 824 echo "\tyour controller and views.\n\n"; 578 825 echo "\tThe generator takes a model name, an optional controller name, and a\n"; 579 826 echo "\tlist of views as arguments. Scaffolded actions and views are created\n"; … … 585 832 echo "\tor under_score and should not be suffixed with 'Model' or 'Controller'.\n\n"; 586 833 echo "Example:\n"; 587 echo "\t ./generatescaffold Account Bank debit credit\n\n";588 echo "\tThis will generate an Account model and BankController with a basic user interface\n";589 echo "\t Now create the accounts table in your database and browse to http://localhost/bank/\n";590 echo "\t voila, you're on Trax!\n\n";834 echo "\tphp script/generate.php scaffold Account Bank debit credit\n\n"; 835 echo "\tThis will generate an Account model and BankController with a basic\n"; 836 echo "\tuser interface. Now create the accounts table in your database and\n"; 837 echo "\t browse to http://localhost/bank/. Voila, you're on Trax!\n\n"; 591 838 echo "Module/Folders Example:\n"; 592 echo "\t ./generatescaffold CreditCard 'admin/credit_card' suspend late_fee\n\n";593 echo "\tThis will generate a CreditCard model and CreditCardController controller\n";594 echo "\t in the admin module.\n";839 echo "\tphp script/generate.php scaffold CreditCard 'admin/credit_card' suspend late_fee\n\n"; 840 echo "\tThis will generate a CreditCard model and CreditCardController\n"; 841 echo "\tcontroller in the admin module.\n"; 595 842 } 596 843 … … 601 848 echo "Usage:\n"; 602 849 echo "Generate Controller:\n"; 603 echo " ./generate.php controller controller_name [view1 view2 ..]\n";604 echo "for more controller info ./generate.php controller\n\n";850 echo "php script/generate.php controller controller_name [view1 view2 ..]\n"; 851 echo "for more controller info php script/generate.php controller\n\n"; 605 852 echo "Generate Model:\n"; 606 echo " ./generate.php model model_name\n";607 echo "for more model info ./generate.php model\n\n";853 echo "php script/generate.php model ModelName\n"; 854 echo "for more model info php script/generate.php model\n\n"; 608 855 echo "Generate Scaffold:\n"; 609 echo " ./generate.php scaffold ModelName [ControllerName] [view1 view2 ...]\n";610 echo "for more scaffold info ./generate.php scaffold\n\n";856 echo "php script/generate.php scaffold ModelName [controller_name] [view1 view2 ...]\n"; 857 echo "for more scaffold info php script/generate.php scaffold\n\n"; 611 858 } 612 859 } 613 860 614 861 // -- set Emacs parameters -- 862 // Local variables: 863 // tab-width: 4 864 // c-basic-offset: 4 865 // c-hanging-comment-ender-p: nil 866 // indent-tabs-mode: nil 867 // End: 615 868 ?>
