pronto/bin/generators/crud/generate.php File Reference

Go to the source code of this file.

Functions

 generate ($template, $dest, $keys, $vals)

Variables

 $genpath = dirname(__FILE__)
 if (!file_exists('profiles/cmdline.php'))
 $db = Registry::get('pronto:db:main')
if($_SERVER['argc']< 3) $entity_name = $_SERVER['argv'][1]
 $human_name = str_replace(' ','_',ucwords(str_replace('_',' ',$entity_name)))
 $db_table = $_SERVER['argv'][2]
 $fnbase = isset($_SERVER['argv'][3]) ? $_SERVER['argv'][3] : $entity_name
 $module = isset($_SERVER['argv'][4]) ? $_SERVER['argv'][4] : ''
 $db_columns = array()
 $basepath = $module ? DIR_FS_APP.DS.'modules'.DS.$module : DIR_FS_APP
 $has_id = false
 $longest = 0
foreach($db_columns as $col) $list_items = ''
foreach($db_columns as $col) $create_items = ''
foreach($db_columns as $col) $keys
 $vals

Function Documentation

generate ( template,
dest,
keys,
vals 
)

Definition at line 135 of file generate.php.

References $fp, $keys, and $vals.


Variable Documentation

$basepath = $module ? DIR_FS_APP.DS.'modules'.DS.$module : DIR_FS_APP

Definition at line 41 of file generate.php.

Referenced by Web::Web().

foreach ($db_columns as $col) $create_items = ''

Definition at line 108 of file generate.php.

$db = Registry::get('pronto:db:main')

Definition at line 19 of file generate.php.

$db_columns = array()

Definition at line 40 of file generate.php.

$db_table = $_SERVER['argv'][2]

Definition at line 37 of file generate.php.

if ($_SERVER['argc']< 3) $entity_name = $_SERVER['argv'][1]

Definition at line 35 of file generate.php.

$fnbase = isset($_SERVER['argv'][3]) ? $_SERVER['argv'][3] : $entity_name

Definition at line 38 of file generate.php.

$genpath = dirname(__FILE__)

PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet

Author:
Judd Vinet <jvinet@zeroflux.org>

Description: A generator for a CRUD model/controller/template files.

WARNING: Currently only MySQL is supported.

Definition at line 13 of file generate.php.

$has_id = false

Definition at line 47 of file generate.php.

$human_name = str_replace(' ','_',ucwords(str_replace('_',' ',$entity_name)))

Definition at line 36 of file generate.php.

foreach ($db_columns as $col) $keys
Initial value:
 array('_ENTITY_',  '_UENTITY_',   '_DEFAULT_SORT_',
              '_DB_TABLE_','_LIST_ITEMS_','_CREATE_ITEMS_',
              '_MODULE_DESIGNATION_')

Definition at line 127 of file generate.php.

Referenced by generate(), Access::serialize_keys(), Access::set_keys(), and Access::unserialize_keys().

foreach ($db_columns as $col) $list_items = ''

Definition at line 88 of file generate.php.

$longest = 0

Definition at line 83 of file generate.php.

$module = isset($_SERVER['argv'][4]) ? $_SERVER['argv'][4] : ''

Definition at line 39 of file generate.php.

$vals
Initial value:
 array($entity_name, $human_name, $db_columns[0]['name'],
              $db_table,    $list_items, $create_items,
              $module ? "\n\t\t".'$this->set_module('."'$module');\n" : '')

Definition at line 130 of file generate.php.

Referenced by generate().

if (generate($genpath.'/templates/t_list.tpl.php',"$basepath/templates/$fnbase/list.php", $keys, $vals)) if(generate($genpath.'/templates/t_create.tpl.php',"$basepath/templates/$fnbase/create.php", $keys, $vals))

Definition at line 14 of file generate.php.


Generated on Wed Jan 13 09:21:02 2010 for Pronto Framework by  doxygen 1.6.1