FUEL CMS User Guide : Version 1.5.2


Fuel Advanced Module Class

This class extends the Fuel_base_library class.

Properties Reference

Property Default Value Description
protected
name N/A Name of the advanced module... usually the same as the folder name
friendly_name N/A Used for display purposes
folder N/A Name of the folder for the advanced module
uri_path N/A The uri_path to the module
_attached N/A Attached objects to the advanced module
_config N/A The config information for the advanced module
_settings N/A The settings information for the advanced module

Function Reference [+]

$this->fuel->advanced_module->initialize([$params=array()])

Initialize the object and set object parameters. Accepts an associative array as input, containing object preferences.

Returns

void

Parameters

(array) $params Array of initalization parameters  (optional)

$this->fuel->advanced_module->__get('$var')

Magic method that will return any attached objects or sub modules attached to the object.

Returns

object

Parameters

(string) $var sub module name

$this->fuel->advanced_module->name()

The name of the module (usually the folder name).

Returns

string

$this->fuel->advanced_module->friendly_name()

The name of the module (usually the folder name).

Returns

string

$this->fuel->advanced_module->folder()

The name of the folder for the module.

Returns

string

$this->fuel->advanced_module->icon()

Returns the icon for the module.

Returns

string

$this->fuel->advanced_module->path(['$full'=TRUE])

The server or web path to the module.

Returns

string

Parameters

(boolean) $full Either return the full path to the module or the relative web_path (optional)

$this->fuel->advanced_module->submodules(['$sub'=NULL])

Returns an array of any sub modules.

Returns

mixed Returns an array if no parameter is set, otherwise it will return an object

Parameters

(string) $sub The name of a particular sub module you want returned (optional)

$this->fuel->advanced_module->models(['$remove_suffix'=FALSE])

The models you can load for this advanced module.

Returns

array

Parameters

(boolean) $remove_suffix Removes the '_model' suffix

$this->fuel->advanced_module->model(['$model'=NULL])

Returns the model of an advanced module that assumes it's the same name.

Returns

array

Parameters

(string) $model The name of a model. If no name is provided, it will assume a model's name the same as the advanced module's (optional)

$this->fuel->advanced_module->attach('$key', ['$obj'=NULL])

Attaches other objects to this object.

Returns

void

Parameters

(string) $key The name to be used for the attached object
(object) $obj The object to attach. If blank, then it will look for a library class of 'Fuel_{$key} in the libraries folder (optional)

$this->fuel->advanced_module->config(['$item'=NULL], ['$look_in_settings'=TRUE])

Returns an advanced module's config item.

Returns

mixed

Parameters

(string) $item The key name for the config item
(boolean) $look_in_settings Determines whether or not to also look into the settings (optional)

$this->fuel->advanced_module->set_config('$item', '$val')

Sets a config item for the advanced module.

Returns

void

Parameters

(string) $item The key value for the config item
(mixed) $val The value of the config item

$this->fuel->advanced_module->config_path()

Return the path to the config file.

Returns

string

$this->fuel->advanced_module->has_config()

Determines if a config file exists for the advanced module.

Returns

boolean

$this->fuel->advanced_module->settings(['$item'=NULL])

An alias to the config method.

Returns

mixed

Parameters

(string) $item The key name for the config item (optional)

$this->fuel->advanced_module->has_settings()

Determines whether or not CMS configurable settings exist.

Returns

array

$this->fuel->advanced_module->settings_fields(['$setting'=NULL])

Returns the settings array from the config file which can be used in the CMS.

Returns

array

Parameters

(string) $setting The setting key. If left blank, then all the settings are returned (optional)

$this->fuel->advanced_module->fuel_url(['$uri'=''])

Returns a URL specific to the advanced module (e.g. http://localhost/fuel/{advanced_module}/create).

Returns

string

Parameters

(string) $uri The URI path relative to the advanced module (optional)

$this->fuel->advanced_module->uri_path()

Returns the URI path specific to the advanced module (e.g. fuel/{advanced_module}).

Returns

string

$this->fuel->advanced_module->set_uri_path('$uri_path')

Sets the URI path for the advanced module.

Returns

string

Parameters

(string) $uri_path The URI path relative to the advanced module

$this->fuel->advanced_module->server_path(['$path'=''])

Returns the server path to the advanced module (e.g. /vars/www/httpdocs/fuel/modules/{advanced_module}/).

Returns

string

Parameters

(string) $path The path to the file relative to the advanced modules directory (optional)

$this->fuel->advanced_module->web_path()

Returns the web path to the advanced module (e.g. /{advanced_module}).

Returns

string

$this->fuel->advanced_module->lib_class_name(['$lowercase'=FALSE])

Returns the advanced modules main class name (e.g. Fuel_my_module).

Returns

string

Parameters

(boolean) $lowercase Whether to return the name lowercased or not (optional)

$this->fuel->advanced_module->lib_class_path()

Returns the server path to the advanced modules main class name (e.g. /vars/www/httpdocs/fuel/modules/{advanced_module}/Fuel_my_module).

Returns

string

$this->fuel->advanced_module->has_lib_class()

Returns the whether a main library class exists or not.

Returns

boolean

$this->fuel->advanced_module->lang_path(['$lang'='english'], ['$file'=NULL])

Returns the server path to the language file.

Returns

string

Parameters

(string) $lang The language folder to pull from. Default is 'english (optional)
(string) $file The language file name. Default is the modules name. (optional)

$this->fuel->advanced_module->has_lang(['$lang'='english'], ['$file'=NULL])

Returns whether the language file exists.

Returns

boolean

Parameters

(string) $lang The language folder to pull from. Default is 'english (optional)
(string) $file The language file name. Default is the modules name. (optional)

$this->fuel->advanced_module->routes()

The routes array specific to the advance module.

Returns

array

$this->fuel->advanced_module->routes_path()

Returns the server path to the advanced module's route file.

Returns

string

$this->fuel->advanced_module->has_routes()

Returns whether a routes file exists for the advanced module.

Returns

boolean

$this->fuel->advanced_module->css_path()

Returns the web path to the advanced modules CSS file.

Returns

string

$this->fuel->advanced_module->has_css()

Returns whether the CSS file exists.

Returns

boolean

$this->fuel->advanced_module->nav()

Returns the navigaiton items for the advanced module.

Returns

mixed (returns an array of navigation menu items or FALSE if none)

$this->fuel->advanced_module->docs()

Returns the contents of the documentation view file found in the advanced modules view/_docs/index.

Returns

string

$this->fuel->advanced_module->docs_path()

Returns the server path to the advanced modules documentation.

Returns

string

$this->fuel->advanced_module->has_docs()

Returns whether documenation exists for the advanced module.

Returns

boolean

$this->fuel->advanced_module->save_cache('$cache_id', '$data', ['$group'=NULL], ['$ttl'=NULL])

Returns the contents of the documentation view file found in the advanced modules view/_docs/index.

Returns

void

Parameters

(string) $cache_id module
(string) $data Cache ID
(string) $group Cache group ID
(mixed) $ttl Data to save to the cache  (optional)

$this->fuel->advanced_module->get_cache('$cache_id', ['$cache_group'=NULL], ['$skip_checking'=FALSE])

Get and return an item from the module's cache.

Returns

string

Parameters

(string) $cache_id Cache ID
(string) $cache_group Cache group ID (optional)
(boolean) $skip_checking Skip checking if it is in the cache or not (optional)

$this->fuel->advanced_module->clear_cache()

Clears the cache folder.

Returns

void

$this->fuel->advanced_module->is_cached('$cache_id', ['$group'=NULL])

Checks if the file is cached based on the cache_id passed.

Returns

boolean

Parameters

(string) $cache_id Cache ID
(string) $group Cache group ID (optional)

$this->fuel->advanced_module->cache_path()

Returns the server path to the advanced modules documentation.

Returns

string

$this->fuel->advanced_module->has_cache()

Returns whether documenation exists for the advanced module.

Returns

boolean

$this->fuel->advanced_module->tests()

Returns whether documenation exists for the advanced module.

Returns

boolean

$this->fuel->advanced_module->has_tests()

Returns whether the advanced module has tests or not.

Returns

boolean

$this->fuel->advanced_module->has_dashboard()

Returns whether the advanced module has a dashboard or not.

Returns

boolean

$this->fuel->advanced_module->has_tools()

Returns whether the advanced module has a tools or not.

Returns

boolean

$this->fuel->advanced_module->tools()

Returns the tools available from the advance module as an array or FALSE if none exist.

Returns

array

$this->fuel->advanced_module->load_config(['$file'=NULL])

Loads the advanced modules config file.

Returns

void

Parameters

(string) $file Name of config file. Default is the name of the advanced module (optional)

$this->fuel->advanced_module->load_helper('$helper')

Loads the advanced modules config file.

Returns

void

Parameters

(string) $helper Name of config file. Default is the name of the advanced module (optional)

$this->fuel->advanced_module->load_library('$library', [$init_params=array()], ['$name'=NULL])

Loads an advanced modules library file and attaches it to the object.

Returns

void

Parameters

(string) $library Name of the library file
(array) $init_params Initialization parameters (optional)
(string) $name Name you want to assign to the loaded library (optional)

$this->fuel->advanced_module->load_view('$view', [$vars=array()], ['$return'=FALSE])

Loads an advanced modules view file.

Returns

mixed string if $return equals TRUE and void if $return equals FALSE

Parameters

(string) $view Name of the view file file
(array) $vars Variables to pass to the view file (optional)
(boolean) $return Whether to return the contents as a string or send it to the output for display

$this->fuel->advanced_module->load_model('$model', ['$name'=NULL])

Loads the advanced modules model file and attaches it to the object.

Returns

void

Parameters

(string) $model Name of the model file.
(string) $name Name you want to assign to the loaded model (optional)

$this->fuel->advanced_module->load_language(['$file'=''], ['$lang'=''])

Loads the advanced modules language file.

Returns

void

Parameters

(string) $file Name of a language file. Default is the name of the advanced module (optional)
(string) $lang Name of a language file folder. Default is "english" (optional)

$this->fuel->advanced_module->install()

Installs the modules.

Returns

boolean

$this->fuel->advanced_module->uninstall()

Uninstalls the modules.

Returns

boolean

$this->fuel->advanced_module->install_info(['$key'=NULL])

Returns the information from the install configuration file.

Returns

string

Parameters

(string) $key The key to the install config you want returned (optional)

$this->fuel->advanced_module->build()

Overwrite this method to run your own custom builds for an advanced module. This can be done by doing it via command line: > php index.php fuel/build/{module}. FUEL uses > php index.php fuel/build to build optimized CSS and JS files.

Returns

mixed