[eluser]veledrom[/eluser]
Hi,
I want to set
$data['page_title'] once not every single time in every method of the current class. How can I do it and echo
$page_title in view files?
$data['page_title'] = 'My sites title'; line gives error;
Thanks
Code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Mysite extends CI_Controller {
$data['page_title'] = 'My sites title';
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['content'] = 'index_view.php';
$this->load->view('template.php', $data);
}
public function two()
{
$data['content'] = 'index_two_view.php';
$this->load->view('template.php', $data);
}
}
/* EoF */