Skip to content

Instantly share code, notes, and snippets.

@harendra21
Created April 18, 2019 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harendra21/82f57b9783318d83c1e536171f76d9b5 to your computer and use it in GitHub Desktop.
Save harendra21/82f57b9783318d83c1e536171f76d9b5 to your computer and use it in GitHub Desktop.
<?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