Application_Generator Class

class Nos\AppWizard\Application_Generator
static Nos\AppWizard\Application_Generator::generate($config, $input)
Parameters:
  • $config (array) –
    generation_path:
     Location of all files needed for the application generation
    folders:Folders to create when generating an application
    files:callback function
    param string $root_dir:
     Root directory where all files must be generated (likely to be the generated application path)
    param array $data:
     Form input
    param array $config:
     Generator configuration
    returns:Array of array, each array defining a file to be generated:
    template:Generate from this view
    data:View data
    destination:
    category_types:
    Key => value array defining categories (fields group type). Key is the category identifier.
    Value is an array containing:
    label:
    fields:Key => value array defining field types. Key is the field type identifier. Value is an array containing:
    label:
    on_model_properties:
     Will the field create an associated model property.
  • $input (array) – Form input
static Nos\AppWizard\Application_Generator::indent($pre, $str)

View helper that allows to keep a consistent indentation when generating code.

Parameters:
  • $pre (string) – Piece of string to be appended before each line (likely to be spaces)
  • $str (string) – Code to be indented
static Nos\AppWizard\Application_Generator::generateFolders($root_dir, $folders)

Generates folders from a list of folder paths

Parameters:
  • $root_dir (string) – Root directory where all folders are generated
  • $folders (array) – List of folder paths
static Nos\AppWizard\Application_Generator::generateFiles($root_dir, $config, $input)

Generates applications files (models, controllers, view), from information on the configuration file and the form values.

Parameters:
  • $root_dir (string) – Root director (likely to be the generated application directory)
  • $config (array) – Configuration
  • $input (array) – Form values