PHP on T R A X
Rapid Application Development Made Easy

Changeset 124 for trunk

Show
Ignore:
Timestamp:
01/23/06 21:41:22 (3 years ago)
Author:
john
Message:

fixed generator to work with folders for scaffolding

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/trax/vendor/trax/trax_generator.php

    r122 r124  
    3636        $view_template_file, 
    3737        $model_template_file, 
    38         $scaffold_template_path; 
     38        $scaffold_template_path, 
     39        $layout_path, 
     40        $layout_filename; 
    3941    public 
    4042        $view_file_extention = TRAX_VIEWS_EXTENTION; 
     
    111113            $this->extra_path = substr($name,0,strrpos($name, "/")); 
    112114            $name = Inflector::underscore(substr($name,strrpos($name, "/")+1)); 
    113             $this->view_path .= "/$this->extra_path/$name"; 
    114             $this->layouts_path .= "/$this->extra_path/$name"; 
     115            $this->view_path .= "/$this->extra_path/$name";            
     116            $this->layouts_path .= "/$this->extra_path"; 
    115117            $this->controller_path .= "/$this->extra_path"; 
    116118            $this->helper_path .= "/$this->extra_path"; 
     
    119121            $this->view_path .= "/$name"; 
    120122        } 
     123        $this->layout_filename = $name; 
    121124 
    122125        $this->controller_class = Inflector::camelize($name); 
     
    317320         
    318321        # Generate the layout for the scaffolding 
    319         $layout_file = "$this->layouts_path/$controller_name.".$this->view_file_extention; 
     322        $layout_file = $this->layouts_path."/".$this->layout_filename.".".$this->view_file_extention; 
     323        if(!file_exists($this->layouts_path)) { 
     324            mkdir($this->layouts_path);         
     325        } 
    320326        ob_start();     
    321327        include("$this->scaffold_template_path/layout.phtml");