I m working on the admin section of a site using Kohana. I ve created a "admin" subfolder within the views folder to store admin views. I m also using a modified instance of the Template Controller for the admin section called Admin Template Controller, seen here:
abstract class Admin_Template_Controller extends Template_Controller
{
public $template = admin/template ;
public function __construct()
{
parent::__construct();
$this->template = View::set_filename($this->template);
$this->template->css = adminstyles ;
$this->template->js = html5 ;
}
}
However, I m getting an error that css variable isn t defined within the "admin/template" file. At this point, the template file is identical to the template file in the views folder that I successfully used to create much of the front end so it s not there. Also, an important fact to note, when I use the template file in the views folder (for the front end) it loads the page correctly.
That leads me to believe it has something to do with the template file being located in a sub folder. That puzzles me though because I successfully load another view file from the same "views/admin" folder. That file doesn t contain any variables though, so maybe that s why it loads.
I ve tried
$this->template = View::factory($this->template);
To load the new template file also, but it returns an error that the view must be called before rendering. I think that s due to auto render being on, but I want it on.
Any ideas would be a big help. Obviously, I could move the file out of the admin folder and rename it, but that s not really going to help me learn what s going on.