- 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
loadLayout Method
This loadLayout
method will be loaded a layout file or view component that file relatives in current theme into view buffer.
Basic Usage
Here is the basic usage of loadLayout
method.
$this->loadLayout(string $layout [, array $data = array()]): $this
Parameters
This method has 1 required parameter and 1 optional parameter.
$layout
The $layout value is string name of a file relatives to current theme.
Layout Requirements
The valid layout should only put inside page
directory of the current theme.
app/
└── view/
└── THEME_NAME/
└── page/
└── [LAYOUT_FILENAME].php
Example
Here is the example for loadLayout
method:
<?php
class Blog extends SENE_Controller {
public function __construct(){
parent::__construct();
$this->setTheme('front');
}
public function index(){
$data = array();
$data['example'] = 'this is example';
$this->setTitle('Blog home');
$this->putThemeContent("blog/home",$data);
$this->putJsContent('blog/home_bottom',$data);
$this->loadLayout('col-1',$data);
$this->render();
}
}
So, the front
theme and col-1
layout should be existed on the directory structure.
app/
└── view/
└── front/
└── page/
└── col-1.php