Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Core;
  4.  
  5. use Philo\Blade\Blade;
  6.  
  7. class CoreController extends \CI_Controller{
  8.  
  9. /**
  10. *@Blade
  11. */
  12. protected $blade;
  13.  
  14. /**
  15. *$data Array
  16. */
  17. protected $data;
  18.  
  19. publicn function __construct(){
  20. parent::__construc();
  21. //initialize instance blade.
  22. $this->blade = new Blade(VIEWPATH, APPPATH.'/cache/');
  23.  
  24. }
  25.  
  26. /**
  27. * render view with Blade instance
  28. */
  29. protected function view($view, $data = [], $return = false){
  30. $this->data = array_merge($this->data, $data);
  31. $blview = $this->blade->view()->make($view, $this->data)->render();
  32. if(! $return )
  33. return print( $blview );
  34. return $blview;
  35.  
  36. }
  37.  
  38. }
  39.  
  40.  
  41. //application/core/CoreController.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement