[eluser]boytun[/eluser]
Thanks wiredesignz.
I just want to tell you that I'm beginner in CI, but about php5 I have the basics , so that why I ask many questions in the forum in order to learn and explore more the framework.
About my question,when I applay your notes, the error is disappeared, but I did not get the desired result concerned the title tag.
this is the modified code:
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;
$ins= new Page();
meta_titles($this->data['page']->title,$ins);
$this->load->view('layout_main', $this->data);
}}
the helper:
Code:
<?php
function meta_titles ($string,$ins)
{
//$CI =& get_instance();
$ins->data['meta_title']=$string.' - '.$ins->data['meta_title'];
/*echo "aaaa";
echo($CI->data['meta_title']);*/
}