content ()¶
(static) Register new content type.
Parameters
String $key Name of content type
String $path Path to the table file
Example:
Config::content( 'mytable', 'package_name/content/mytable.php' );
Common methods for Gila CMS
(static) Adds language translations from a json file.
Parameters
$path:string Path to the folder/prefix of language json files
Example:
Config::addLang('mypackages/lang/');
(static) Adds en element in a global array.
string $list: Name of the list
mixed $el: Value
(static) Returns the array of a list.
Parameters
$list:string Name of the list
(static) Register new widgets.
Parameters
$list:Array
Example:
Config::widgets( [‘wdg’=>’my_package/widgets/wdg’] );
(static) Register new content type.
Parameters
String $key Name of content type
String $path Path to the table file
Example:
Config::content( 'mytable', 'package_name/content/mytable.php' );
(static) Make changes on an existing content type.
Parameters
String $key: Name of content type
Function $init: Function to run when initializes the content type object
Example:
Config::contentInit( 'mytable', function(&$table){
// unlist a column from content administration
&$table['fields']['column1']['list] = false;
});
(static) Returns an array with the active packages names.
(static) Gets the value of configuration/option element.
Parameters
$key:string Index of the element.
(static) Sets the value of configuration/option element.
Parameters
$key:string Index of the element.
$value:mixed The value to set.
(static) Updates the config.php file.
(static) Generates a hash password from a string. Returns hashed password.
$pass:string The string to be hashed.
(static) Gets an option value in array form if it was saved in json format.
Parameters
string $option: Option name.
(static) Creates the folder if does not exist and returns the path.
Parameters
$path:string Folder path.
(static) Generates a url. Return the url path to print.
Parameters
$str:string The path.
$args:Array (optional) The query parameters in array.
Examples:
$url = Config::url('blog/post',['id'=>1]);`` returns mysite.com/blog/post?id=1
(static) Generates a url. Returns the full url path to print.
Parameters
$str:string The path.
Examples:
$url = Config::base('blog/post?id=1');`` returns https://mysite.com/blog/post?id=1
(static) Returns modification times in seconds.
Parameters
string/Array
Example:
Config::mt('my-table')
(static) Updates modification time in seconds. You can use this function from your model classes. The cm controller runs updateMt() for any content type in update action.
Parameters
string/Array
Example:
Config::updateMt('my-table')
Styled using the Piccolo Theme