PHP Class Services\ModuleBuilder

Show file Open project: doptor/doptor

Public Properties

Property Type Description
$selected_forms
$templatePath

Protected Properties

Property Type Description
$form_rendered
$module_name
$nav_tabs
$temp_dir

Public Methods

Method Description
SearchandReplace ( string $dir, string $stringsearch, string $stringreplace ) : array Recursively replace all occurences of string within a directory
Zip ( $source, $destination, boolean $include_dir = true ) : boolean Compresses a folder
__construct ( )
createModule ( $input )
generateForm ( $form ) : string Generate the complete form
getCaptchaField ( integer $form ) Get captcha to add to form if captcha option is selected
getFormFields ( $form_data ) : array Get the available form fields from the generated form
getFormSelects ( $form_id ) : array Get all the select/dropdown fields in a form
setFormDropdownSources ( $input ) : string

Private Methods

Method Description
adjustFiles ( $input ) Adjust the template files according to the provided input
copyTemplate ( ) Copy the module template to a temporary directory
generateHashForNullHashModules ( )
generateInnerForm ( ) Generate the inner portion form based on the input
generateModelName ( $table_name ) : mixed Generate model name from the table name specified
generateModuleAlias ( $module_name ) : mixed Generate the alias of the module
generateModules ( ) Generate modules for each form tables
generateRoutes ( array $targets ) : string
generateTableName ( $module_name, $form_name ) : string Generate table name, for the selected module and form
generateZip ( $module_alias ) : string Generate a zip file of the module
getFormInfo ( $index ) Get the information about the form
getRequiredModulesInfo ( $input )
getSelectedForms ( $input ) Get all the forms that were selected
saveModuleConfig ( $input, $module_alias, $requires ) Save the module configuration to a json file

Method Details

SearchandReplace() public method

Recursively replace all occurences of string within a directory
public SearchandReplace ( string $dir, string $stringsearch, string $stringreplace ) : array
$dir string Source Directory
$stringsearch string String to search
$stringreplace string String to replace
return array

Zip() public method

Compresses a folder
public Zip ( $source, $destination, boolean $include_dir = true ) : boolean
$source
$destination
$include_dir boolean
return boolean

__construct() public method

public __construct ( )

createModule() public method

public createModule ( $input )

generateForm() public method

Generate the complete form
public generateForm ( $form ) : string
$form
return string

getCaptchaField() public method

Get captcha to add to form if captcha option is selected
public getCaptchaField ( integer $form )
$form integer

getFormFields() public method

Get the available form fields from the generated form
public getFormFields ( $form_data ) : array
$form_data
return array

getFormSelects() public method

Get all the select/dropdown fields in a form
public getFormSelects ( $form_id ) : array
$form_id
return array

setFormDropdownSources() public method

public setFormDropdownSources ( $input ) : string
$input
return string

Property Details

$form_rendered protected property

protected $form_rendered

$module_name protected property

protected $module_name

$nav_tabs protected property

protected $nav_tabs

$selected_forms public property

public $selected_forms

$temp_dir protected property

protected $temp_dir

$templatePath public property

public $templatePath