Created
April 18, 2019 06:07
-
-
Save harendra21/82f57b9783318d83c1e536171f76d9b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
use Coolpraz\PhpBlade\PhpBlade; | |
class MY_Controller extends CI_Controller { | |
protected $views = APPPATH . 'views'; | |
protected $cache = APPPATH . 'cache'; | |
protected $blade; | |
public function __construct(){ | |
parent::__construct(); | |
$this->blade = new PhpBlade($this->views, $this->cache); | |
} | |
public function front_render($view_name,$data,$head){ | |
echo $this->blade->view()->make('_parts/header', $head); | |
echo $this->blade->view()->make($view_name, $data); | |
echo $this->blade->view()->make('_parts/footer', $head); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment