Welcome Guest, Not a member yet? Register   Sign In
CI 3 and GroceryCrud Object Issue
#1

Okay,

Code Igniter has been great to program with. However I am running into a issue with my templating and view.

I would like to pass the grocerycrud object (rendered) to my view via the data variable, and it gives me an error.  My other pages work great, and everything is fine, EXCEPT trying to get a Grocery CRUD on one of my views.

Any help would be greatly appreciated.

Message: Object of class stdClass could not be converted to string


I have a template library, view, and controller below.

Controller:

PHP Code:
public function users()
{
$this->grocery_crud->set_table('users');
$output $this->grocery_crud->render();
 
//$this->_example_output($output); 


$arrayx = array(
        
'crud' => $output,
        
'data' => $data null,
);
$this->template->display($arrayx);
}
 
function 
_example_output($output null$data null)
 


View:

Has a PHP echo  $output


Template:
PHP Code:
<?php

class Template{

protected 
$_ci;

function 
__construct(){

$this->_ci=&get_instance();

}

function 
display($data=null){
    
$data['_assets']=$this->_ci->load->view('template/assets',$data,true);    

// Load the header (Logo, search, profile, user menu, chat, etc)
$data['_header']=$this->_ci->load->view('template/header',$data,true);

// Load the side bar profile
$data['_profile']=$this->_ci->load->view('template/profile',$data,true);

// Load the side bar (Complete menu)
$data['_sidebarmenu']=$this->_ci->load->view('template/sidebar_menu',$data,true);

// Load the footer widget (Progress bar with logout option)
$data['_sidebarfooter']=$this->_ci->load->view('template/sidebar_footer',$data,true);

// Load content for the page
//$data['_container']=$this->_ci->load->view('template/container',$data,true);

$data['_content']=$this->_ci->load->view('admin/users',$data,true);

// Load chat for the page
$data['_chat']=$this->_ci->load->view('template/chat',$data,true);

// Send data to the page
$this->_ci->load->view('template.php'$data);

}

}

?>
Reply


Messages In This Thread
CI 3 and GroceryCrud Object Issue - by beijingjim - 11-23-2016, 02:40 PM
RE: CI 3 and GroceryCrud Object Issue - by salain - 11-23-2016, 11:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB