dev-master
9999999-devUtility to render views quick and easy
MIT
The Requires
- php >=5.4.0
- brunnofoggia/darktrait 1.*
1.0.0
1.0.0.0Utility to render views quick and easy
MIT
The Requires
- php >=5.4.0
- brunnofoggia/darktrait 1.*
Wallogit.com
2017 © Pedro Peláez
Utility to render views quick and easy
Utility to render views quick and easy, (*2)
Implement it into your class, (*3)
class Test {
use \ChillRender;
}
Set your paths, (*4)
protected $attrDefaults = [
'layout' => 'views/layout', // file extension is .php by default, but you can send yours
'viewPath' => 'views/'
];
Rendering, (*5)
// Just rendering
$this->render('index');
// Sending data to view
$this->render('views/index', ['mydata' => $data]);
// Rendering with other layout
$this->render('views/index', [], 'views/other_layout');
// Rendering without layout
$this->render('views/index', [], false);
// Rendering layout with custom content
$this->renderLayout(['content' => $custom]);
// Rendering a partial view
$this->renderPartial('views/sidebar', ['mydata' => $data]);
Utility to render views quick and easy
MIT
Utility to render views quick and easy
MIT