Advertisement
SashaRaaa

Untitled

Jul 24th, 2018
1,181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. class View
  4. {
  5.     protected $data = [];
  6.     protected $template;
  7.  
  8.     public function assign($name, $value)
  9.     {
  10.         $this->data[$name] = $value;
  11.     }
  12.  
  13.     public function display($template)
  14.     {
  15.         $this->template = __DIR__ . $template;
  16.         include $this->template;
  17.     }
  18.  
  19.     //public function render($template) {
  20.      //   $this->template = __DIR__ . $template;
  21.      //   return $this->template;
  22.     //}
  23.  
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement