An uncaught Exception was encountered Type: Error
Message: Object of class stdClass could not be converted to string
Filename: /my_project/system/libraries/Parser.php
Line Number: 150
I got this type of error in my Codeigniter project which was running before. I want a solution that doesn't have to go to every controller and change it
this is my code in controller.
if( $this->uri->segment(2) )
{
$slugdata = $this->uri->segment(2);
$data['course_data']= $this->Course_model->get_course_data($slugdata);
$data['trainer']= $this->Course_model->get_trainer_by_id($data['course_data']->lecturer);
$meta_title = strip_tags($data['course_data']->meta_title);
$meta_keyword = strip_tags($data['course_data']->meta_keyword) ;
$meta_descrip = strip_tags($data['course_data']->meta_descrip) ;
$canonical_tag = strip_tags($data['course_data']->canonical_tag) ;
$robot_index = strip_tags($data['course_data']->robot_index) ;
$robotindex = $data['course_data']->robotindex;
$this->template->set('title',$meta_title);
$this->template->set('MetaKeyword',$meta_keyword );
$this->template->set('MetaDescription',$meta_descrip );
$this->template->set('CanonicalTag',$canonical_tag );
$this->template->set('RobotIndex',$robot_index );
$this->template->set('MainIndex',$robotindex );
$this->template->set_layout('layout_main', 'front');
$this->template->build('course-details',$data);
}
and this is in view
<div class="col-md-6 col-sm-6">
<ul class="pull-right breadcrumb">
<li><a href="<?php echo base_url();?>">Home</a></li>
<li class="active"> <?php echo $course_data->course_name;?></li>
</ul>
</div>