Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Core;
- use Philo\Blade\Blade;
- class CoreController extends \CI_Controller{
- /**
- *@Blade
- */
- protected $blade;
- /**
- *$data Array
- */
- protected $data;
- publicn function __construct(){
- parent::__construc();
- //initialize instance blade.
- $this->blade = new Blade(VIEWPATH, APPPATH.'/cache/');
- }
- /**
- * render view with Blade instance
- */
- protected function view($view, $data = [], $return = false){
- $this->data = array_merge($this->data, $data);
- $blview = $this->blade->view()->make($view, $this->data)->render();
- if(! $return )
- return print( $blview );
- return $blview;
- }
- }
- //application/core/CoreController.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement