Jump to content


abdika

Member Since 23 Jul 2012
Offline Last Active Jul 30 2012 09:54 AM
-----

Topics I've Started

How to include output from grocery crud to my template

23 July 2012 - 07:26 AM

Hi, it's firstime i using grocery crud. I't very cool, but i have a problem.
I want to show output from grocery crud to my template
this is my Controler
[code=auto:0] public function manageUser() { $crud = new grocery_CRUD();
$crud->set_table('users');
$crud->set_theme('flexigrid');
$crud->columns('username','email','tingkat','id_group');
$crud->display_as('id_group','kelompok'); $crud->display_as('tingkat','level'); $crud->fields('username','password','email','tingkat','id_group'); $crud->display_as('id_group','kelompok'); $crud->change_field_type('password', 'password');
//$crud->change_field_type('kelompok','enum');
$crud->set_relation('id_group','groups','kelompok' );
$output = $crud->render(); // $this->load->view('header.php');
$this->load->view('example',$output);

this is my template view


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
<title><?php echo $page_title;?></title>
<meta charset="utf-8" />
<meta name="description" content="Manage News Basket" />
<meta name="author" content="BeritaSatu" />

<style type="text/css">@import url("<?php echo base_url().'css/template.css'; ?>");</style>
<style type="text/css">@import url("<?php echo base_url().'css/admin.css'; ?>");</style>

</head>
<?php flush();?>
<body>
<div class="header-bar">
<?php $this->load->view('header', $username); ?>
</div>
<div class="container">
<div class="navigation">
<div class="navigation-inner">
<?php $this->load->view('admin_navigation'); ?>
</div>
</div>
<div id="main" class="main">
<?php $this->load->view('example'); ?>
</div>
<div class="footer-bar">
<?php $this->load->view('footer'); ?>
</div>
</div>

<script type="text/javascript" src="<?php echo base_url().'/library/jquery.js'; ?>"></script>
<script type="text/javascript" src="<?php echo base_url().'/library/tablesorter/jquery.tablesorter.js'; ?>"></script>
<script type="text/javascript" src="<?php echo base_url().'/library/myscript.js'; ?>"></script>
</body>

</html>


i want to show the output in main class, how to implement it?
Attached File  cats2.jpg   44.91K   913 downloads