- 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
setTheme Method
The setTheme
method purpose is for set a theme view for current controller.
Basic Usage
Here is the basic usage of setTheme
method from SENE_Controller .
setTheme(string $theme_name): $this
Parameters
setTheme requires 1 parameter it is $theme_name.
$theme_name
The $theme_name
value can be a directory name under app/view
, learn more about view theme .
Theme Name Requirements
The valid themes should contain these files with this directory structure.
|app/
└── view/
└── [THEME_NAME]/
├── theme.json
├── script.json
└── page/
└── col-1.php
Example
Here is the example for setTheme
method.
class Home extends SENE_Controller
{
public function __construct()
{
parent::__construct();
$this->setTheme('homepage');
}
public function index()
{
...
}
}
So, the directory homepage
should be existed on the directory structure.
| app/
|- view/
|-- homepage/
|--- theme.json
|--- script.json
|--- page/
|----- col-1.php