BEST Offers , For All Sximo 5 LTS licence Holer , Upgrade Licence For only $14 Normal Price on Codecanyon $31
New product Sximopress ( Wordpress Builder ) 1.0 has been realesed . download it now !

S5 Ultimate

The Real PHP Application Makers

Forms Input fields

First of all when you call and render the cruds , it will create automatic form input fileds based on database field type table . Of course you may want to change them into your input need .

Method Function

forms( 'param1','param2',[param3])

Params & Arguments

This method required 2 or 3 parameters , depending input type . first parameter is string , second string and last is array. Each type input will have different arguments for array parameter , depending of input type.
('field(string)','type(string),array)
Array Arguments
This array arguments are accepted by all input type
[
  'class'     => ''
  'attribut'  => ''
  'style'     => ''

]
Example
$CrudEngine->table('employees')
           ->forms('photos','upload',['path'=>'/uploads/photos'])
           ->forms('coments','editor')
           ->render();
The first parameteris field table, second is type of input then last array parameter if any . .

Text

Format as input form
forms( 'field','text')

Textarea

Format as input textarea form
forms( 'field','textarea')

Editor

Format as input textarea with editor wyswyg form
forms( 'field','editor')

Date

Format as input with datepicker form
forms( 'field','date')

Datetime

Format as input with datetimepicker form
forms( 'field','datetime')

Time

Format as input timeform
forms( 'field','time')

Year

Format as input year form
forms( 'field','year')

Select

Format as input select database/custom form
forms( 'field','select',[array])

Additional arguments

Accepted array arguments by this type
[
  'lookup'   => 'tablename:tablekey:displayfield-displayfield2' // Select value from database
  'options'  => '0:Inactive , 1:Active' //  option values are separated by semicolumn
  'multiple' => 'true' // allow multiple uploads ,'true' is multiple 
]
lookup or options are mandatory. its only allowed one , choose lookup or options .
Example
// Select with option value from database lookup
->forms('customerNumber','select',[
         'lookup'   => 'customers:customerNumber:customerName'
       ])
// Select with custom option value
->forms('status','select',[
         'options'   => 'pending:Pending,shipped:Shipped,canceled:Canceled'
       ])

Upload

Format as input upload file/image form
forms( 'field','upload',[array])
Additional arguments
Accepted array arguments by this type
[
  'path'     => '/uploads/folder/' // define folder location for uploaded file/image
  'type'     => 'image' // upload as `image` or `file` 
  'multiple' => 'true' // allow multiple uploads ,'true' is multiple 
  'resize'  => '200' // Resize image to 200px
]
path is mandatory.
Example
->forms('photos','upload',[
          'type'=>'image',
          'path'=>'/uploads/folder/'
       ])

Radio

Format as input radio form
forms( 'field','radio','[array]')
Additional arguments
Accepted array arguments by this type
[
  'options'     => '0:Inactive , 1:Active' // option values are separated by semicolumn 
]
options is mandatory.
Example
->forms('status','radio',['options'     => '0:Inactive , 1:Active'])

Checkbox

Format as input checkbox form
forms( 'field','checkbox')
Additional arguments
Accepted array arguments by this type
[
  'options'     => '0:Inactive , 1:Active' // option values are separated by semicolumn 
]
options is mandatory.
Example
->forms('status','checkbox',['options' => '0:Inactive , 1:Active'])

Please Register Purchased Code for full access Docs


Last Update : 2017-10-13 15:57:20