- Seme Framework
- version 4.0.3
- Requirements
- Download & Install
- Configuration
- Tutorials
- URI Routing
- Constants
- Global Variables
- Model
- View
- Controller
- cdn_url
- config
- constructor
- getAdditional
- getAdditionalBefore
- getAdditionalAfter
- getAuthor
- getCanonical
- getContentLanguage
- getDescription
- getIcon
- getJsContent
- getJsFooter
- getJsReady
- getKey
- getKeyword
- getLang
- getRobots
- getShortcutIcon
- getThemeElement
- getTitle
- input
- lib
- load
- loadCss
- loadLayout
- putThemeContent
- putJsContent
- putJsFooter
- putJsReady
- render
- resetThemeContent
- session
- setAuthor
- setCanonical
- setContentLanguage
- setDescription
- setIcon
- setKey
- setKeyword
- setLang
- setShortcutIcon
- setTheme
- setTitle
- Library
- CLI (command line interface)
- Core
- Issue
- Deployment
Config Property
The $config
property contains about object from selected Seme Framework file configuration.
While accessing this property, every variables that existing on configuration will be converted as object.
Basic Usage
Here is the basic usage $config
property method from SENE_Controller class.
$this->config->{$object_config_name};
$object_config_name
The value of $object_config_name
value can be a string, object, or array depends on value that existing on configuration.
Examples
Here is the example usage config property in a controller file.
...
//print the database connection host
echo $this->config->db['host'];
...
Get Current Configration File
Seme Framework allows 3 different configration there is development.php, staging.php, and production.php.
If we want to know which setting is being used, we can do this by calling this $config
property.
Let's take a look at the sample code snippet in a controller class below.
...
echo $this->config->environment;
// will print:
// - development, or
// - staging, or
// - production
...
Semevar Property
The $this->config->semevar
property is an object of the $semevar
variable in the Seme Framework settings file.
This property is used to retrieve hardcode values for application development needs.
In this example, we will see how to retrieve the $semevar
value from the settings file into the $this->config
property in a controller file.
The following is an example of the contents of the $semevar
array in the Seme Framework settings file.
...
$semevar['site_name'] = 'Cipta Esensi Merenah';
$semevar['site_version'] = '1.0.0';
...
And then on controller, we can get the values from config through controller.
...
echo $this->config->semevar->site_name.' v'.$this->config->semevar->site_version;
...