FUEL CMS User Guide : Version 1.3.2


Fuel Blocks Model Class

Fuel_blocks_model is used for managing CMS administrable blocks.

This class extends the Base_module_model class.

Properties Reference

Property Default Value Description
public
required
array('name')
Name is required
filters
array('description', 'view')
Allows for the description field to be searchable as well as the name field
ignore_replacement
array('name')
The name value will be ignored when one record replaces another
parsed_fields
array('view')

Function Reference [+]

$this->fuel->blocks_model->list_items(['$limit'=NULL], ['$offset'=NULL], ['$col'='name'], ['$order'='desc'], ['$just_count'=FALSE])

Lists the module items.

Returns

mixed If $just_count is true it will return an integer value. Otherwise it will return an array of data

Parameters

(int) $limit The limit value for the list data
(int) $offset The offset value for the list data
(string) $col The field name to order by
(string) $order The sorting order
(boolean) $just_count Determines whether the result is just an integer of the number of records or an array of data

$this->fuel->blocks_model->options_list_with_views([$where=array()], ['$dir_folder'=''], ['$dir_filter'='^_(.*)|\.html$'], ['$order'=TRUE], ['$recursive'=TRUE])

$this->fuel->blocks_model->form_fields([$values=array()], [$related=array()])

Block form fields.

Returns

array An array to be used with the Form_builder class

Parameters

(array) $values Values of the form fields (optional)
(array) $related An array of related fields. This has been deprecated in favor of using has_many and belongs to relationships (deprecated)

$this->fuel->blocks_model->on_before_validate($values)

Model hook ran before validation that will check to make sure it's not a block that already exists.

Returns

array An array of values that will be sent to the validate method before saving

Parameters

(array) $values An array of values to be saved

$this->fuel->blocks_model->is_new_block('$name', '$lang')

Method used with on_before_valid model hook.

Returns

boolean

Parameters

(string) $name The name of the block
(string) $lang The language associated with the block

$this->fuel->blocks_model->is_editable_block('$name', '$id', '$lang')

Method used with on_before_valid model hook.

Returns

boolean

Parameters

(string) $name The name of the block
(int) $id The records ID
(string) $lang The language associated with the block


Fuel Block Model Class

This class extends the Base_module_record class.