Answer the question
In order to leave comments, you need to log in
How to display $title variable from Kohana controller?
Hello! Can't display variable with page title.
In the main controller, it is declared like this:
public function before() {
parent::before();
View::set_global('title', 'Мой сайт');
}
<title>echo $title; </title>
echo $product['xxx'];
public function action_product()
{
$this->template->title = $product['title'];
}
ErrorException [ Notice ]: Undefined variable: product
APPPATH\classes\Controller\Products.php [ 14 ]
public function action_product()
{
$this->template->title ='Text';
}
Answer the question
In order to leave comments, you need to log in
The error says that you are doing something wrong:
Where is the $product variable declared?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question