always show unknown text("array array")
- Single Page
Posted 15 December 2012 - 06:45 AM
i make a standart coding with grocerycrud for my project, but when i running in browser i get this unknown text "array array".
it's a screenshoot
[attachment=397:arra.png]
Posted 15 December 2012 - 07:05 AM
Posted 15 December 2012 - 07:27 AM
<?php
class Admin extends CI_Controller{
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('grocery_CRUD');
}
function index()
{
$data['output'] = (object)array('output' => '' , 'js_files' => array() , 'css_files' => array());
$data['isi']='admin/dashboard';
$this->load->view('admin/template',$data);
}
function user()
{
try{
$crud = new grocery_CRUD();
$crud->set_table('user');
$crud->set_subject('User');
$crud->required_fields('username');
$crud->change_field_type('password', 'password');
$data['output']=$crud->render();
$data['isi']='admin/crud';
$this->load->view('admin/template',$data);
}catch(Exception $e){
show_error($e->getMessage().' --- '.$e->getTraceAsString());
}
}
}
?>
i call function user() and
it's my view(template.php) :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php
foreach($output->css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<?php foreach($output->js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
<link href="<?php echo base_url(); ?>/public/css/adminstyle.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url(); ?>/public/css/menu.css" type="text/css" rel="stylesheet" />
<title>Control Panel Waka Wiki</title>
</head>
<body>
<?php echo $this->load->view('admin/header');?>
<div id="tengah">
<?php echo $this->load->view($isi);?>
</div>
<div id="footer">
asdfasdf
</div>
</body>
</html>
in line <?php echo $this->load->view($isi);?> it's load view "crud.php"
<div id="crud">
<?php
foreach($output as $out): ?>
<? echo $out; ?>
<?php endforeach; ?>
</div>
please help me
(sorry for my bad english)
Posted 15 December 2012 - 09:49 AM
<div id="crud">
<?php
foreach($output as $out): ?>
<? echo $out; ?>
<?php endforeach; ?>
</div>
the $out is array.
$out[1] = "Your grid"
$out[2] = array('css_files'=>array(.....))
$out[3] = array('js_files'=>array(.....))
----------------------------------------
try this:
<div id="crud">
<?php
echo $output->output ?>
</div>
Posted 15 December 2012 - 10:49 AM
very very help me, thank's my friends