Changeset 262

Show
Ignore:
Timestamp:
06/23/07 21:09:03 (1 year ago)
Author:
bermiferrer
Message:

Improving generators

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/script/generators/controller/controller_generator.php

    r2 r262  
    6666        $this->save(AK_TEST_DIR.DS.'fixtures'.DS.'app'.DS.'helpers'.DS.$this->underscored_controller_name."_helper.php", $this->render('helper_fixture')); 
    6767         
     68        @Ak::make_dir(AK_VIEWS_DIR.DS.AkInflector::underscore($this->class_name)); 
     69         
    6870        foreach ((array)@$this->actions as $action){ 
    6971            //$this->action = $action; 
  • trunk/script/generators/model/model_generator.php

    r2 r262  
    6868            $this->save($file_path, $this->render($template)); 
    6969        } 
     70         
     71        $installer_path = AK_APP_DIR.DS.'installers'.DS.$this->underscored_model_name.'_installer.php'; 
     72        if(!file_exists($installer_path)){ 
     73            $this->save($installer_path, $this->render('installer')); 
     74        } 
     75         
    7076    } 
    7177     
  • trunk/script/generators/model/templates/installer.tpl

    r155 r262  
    55    function up_1() 
    66    { 
    7         $this->createTable('<?php  echo $table_name?>', " 
    8           id integer not null auto increment pk 
    9         ");   
     7        /** / 
     8        $this->createTable('<?php  echo AkInflector::tableize($class_name); ?>', " 
     9          id, 
     10          created_at, 
     11          updated_at 
     12        "); 
     13        /**/ 
    1014    } 
    1115     
    1216    function down_1() 
    1317    { 
    14         $this->dropTable('<?php  echo $table_name?>');   
     18        /** / 
     19        $this->dropTable('<?php  echo AkInflector::tableize($class_name); ?>'); 
     20        /**/ 
    1521    } 
    1622