Changeset 201 for trunk/trax/vendor/trax/trax_generator.php
- Timestamp:
- 05/25/06 02:58:10 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/trax_generator.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/trax_generator.php
r200 r201 136 136 137 137 /** 138 * Value of the view files extension (usually '.phtml')139 * @var string140 */141 public $view_file_extention = TRAX_VIEWS_EXTENTION;142 143 /**144 138 * Constructor for the TraxGenerator object 145 139 * … … 147 141 * subdirectories of the Trax work area and the template files 148 142 * used to generate application files 149 * @uses $GLOBALS['TRAX_INCLUDES'] 150 * @global string[] $GLOBALS['TRAX_INCLUDES'] Array of paths to 151 * various Trax directories 143 * 152 144 * @uses controller_path 153 145 * @uses controller_template_file … … 162 154 */ 163 155 function __construct() { 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']; 156 $this->view_path = Trax::$views_path; 157 $this->controller_path = Trax::$controllers_path; 158 $this->helper_path = Trax::$helpers_path; 159 $this->model_path = Trax::$models_path; 160 $this->layouts_path = Trax::$layouts_path; 174 161 $this->controller_template_file = 175 162 TRAX_LIB_ROOT . "/templates/controller.php"; … … 573 560 echo $e->getMessage()."\n"; 574 561 echo "for database '" 575 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['database']562 . Trax::$database_settings[TRAX_ENV]['database'] 576 563 . "' on host '" 577 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['hostspec']564 . Trax::$database_settings[TRAX_ENV]['hostspec'] 578 565 . "' as user '" 579 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['username']566 . Trax::$database_settings[TRAX_ENV]['username'] 580 567 . "'\nDid you configure file " 581 . T RAX_ROOT . $GLOBALS['TRAX_INCLUDES']['config']568 . Trax::$config_path 582 569 . "/database.ini correctly?\n"; 583 570 die(); … … 631 618 632 619 # Generate the index.phtml view 633 $view_file = "$this->view_path/index.". $this->view_file_extention;620 $view_file = "$this->view_path/index.".Trax::$views_extension; 634 621 ob_start(); 635 622 include("$this->scaffold_template_path/view_index.phtml"); … … 647 634 648 635 # Generate the add.phtml view 649 $view_file = "$this->view_path/add.". $this->view_file_extention;636 $view_file = "$this->view_path/add.".Trax::$views_extension; 650 637 ob_start(); 651 638 include("$this->scaffold_template_path/view_add.phtml"); … … 663 650 664 651 # Generate the edit.phtml view 665 $view_file = "$this->view_path/edit.". $this->view_file_extention;652 $view_file = "$this->view_path/edit.".Trax::$views_extension; 666 653 ob_start(); 667 654 include("$this->scaffold_template_path/view_edit.phtml"); … … 679 666 680 667 # Generate the show.phtml view 681 $view_file = "$this->view_path/show.". $this->view_file_extention;668 $view_file = "$this->view_path/show.".Trax::$views_extension; 682 669 ob_start(); 683 670 include("$this->scaffold_template_path/view_show.phtml"); … … 695 682 696 683 # Generate the partial containing the form elments from the database 697 $view_file = "$this->view_path/_form.". $this->view_file_extention;684 $view_file = "$this->view_path/_form.".Trax::$views_extension; 698 685 ob_start(); 699 686 require "$this->scaffold_template_path/form_scaffolding.phtml"; … … 711 698 712 699 # Generate the layout for the scaffolding 713 $layout_file = $this->layouts_path."/" 714 . $this->layout_filename."." 715 . $this->view_file_extention; 700 $layout_file = $this->layouts_path."/".$this->layout_filename.".".Trax::$views_extension; 716 701 if(!file_exists($this->layouts_path)) { 717 702 mkdir($this->layouts_path); … … 839 824 * @uses controller_class Must be set before call. 840 825 * Not changed during call. 841 * @uses view_file_extension Must be set before call.842 * Not changed during call.843 826 * @uses view_path Must be set before call. 844 827 * Not changed during call. … … 848 831 */ 849 832 function create_view($view, $controller) { 850 $view_file = "$this->view_path/".$view.".". $this->view_file_extention;833 $view_file = "$this->view_path/".$view.".".Trax::$views_extension; 851 834 if(!file_exists($view_file)) { 852 835 if(file_exists($this->view_template_file)) {
