[eluser]boytun[/eluser]
Hello
In my application I use the Hmvc structure.
the main structure of my application is like this
Code:
+application
+controllers
+page(Class page extends Frontend_Controller)-->load the main.php's view.
+helpers
+cms_helpers.php
+librairies
+Frontend_Controller.php(Class Frontend_Controller extend MX_Controller)
+view
+main.php
I use the meta_titles function to build the title of my page(ex:
site-contact)
but when I try to excute the page,everything work fun, only the title of my page is not showed perfectly, and I get this error:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI::$data
Filename: helpers/cms_helper.php
Line Number: 6
this is my cms_helpers's fils:
Code:
<?php
function meta_titles ($string)
{
$CI =& get_instance();
$CI->data['meta_title']=$string.' - '.$CI->data['meta_title'];
/*echo "aaaa";
echo($CI->data['meta_title']);*/
}
and this my controller:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Page extends Frontend_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->model('page_m');
$this->load->model('widget_m');
$this->data['page']=$this->page_m->get_by(array('slug'=> (string)$this->uri->segment(1)),TRUE);
$this->data['widgets']=$this->widget_m->get();
//echo "<pre>";var_dump($this->data['page']);echo "</pre>";
$methode="_".$this->data['page']->template;
$this->$methode();
$this->data['subview']=$this->data['page']->template;
// her, I call the meta_titles function, located in the cms_helper.php
meta_titles($this->data['page']->title);
$this->load->view('main', $this->data);
}
Thanks for any hints.
Regards
boytun