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

Format Columns

to formating rows value from database and displaying in table grid columns can be done using format() methods Crud Engine have several default formatter Formation columns value can be done using method format( array ) .

Method

format( array )

params & arguments

This method required array value as param
['string_format' => 'string_arguments`]
Each format type will have different arguments , please check arguments for each format type

Available String Format


Link

Make rows as link to other page using format( array )
Argument
['fieldname' => 'link|link_to']

Number / Currency

Make rows as number or currecny
Argument
//Number
['fieldname' => 'number']
//Currency
['fieldname' => 'number|$']
Example
$CrudEngine->table('empoyees)
           ->format(['email'=>'link|mailto'])
           ->render();

Image & File

format row as image / file
Argument
['fieldname' => 'upload|path_to_upload']
Example
$CrudEngine->table('empoyees)
           ->format(['photos'=>'upload|path.to.upload'])
           ->render();

Lookup

Format row as value took from other table
Argument
['fieldname' => 'lookup|tablename:tablekey:field_to_display']
Example
$CrudEngine->table('empoyees)
           ->format([
              'reportsTo'=>'lookup|employees:employeeNumber:firstName-lastName'
            ])
           ->render();

Option

format row as value from checkbox or radio input
Argument
['fieldname' => 'radio|0,InActive:1,Active']
Example
$CrudEngine->table('empoyees)
           ->format(['status'=>'radio|0,InActive:1,Active'])
           ->render();

Function

Format row with your own function
Argument
['fieldname' => 'function|classname:methodname:field']
Example
$CrudEngine->table('empoyees)
           ->format(['status'=>'function|MyHelpers:Method:args'])
           ->render();

Please Register Purchased Code for full access Docs


Last Update : 2017-10-13 15:56:42