All pastes #797228 Raw Edit

Untitled

public text v1 · immutable
#797228 ·published 2007-11-25 21:10 UTC
rendered paste body
<?php

class Main extends Controller {

	function Main() 
	{
		parent::Controller();
		include 'formulario.php';
		include 'lista.php';
		//$this->load->scaffolding('blog');

		print_r($this);
 //die();
		
		$this->load->helper('url');
		$this->load->helper('form');
		
	}
	
	function index()
	{
		
		switch($this->uri->segment(3)) {
			case 'list':
				$obj = new Lista($this->uri->segment(4));
				break;
			case 'edit':
				$obj = new Formulario($this->uri->segment(4),$this->uri->segment(5));
				break;
			case 'add':
				$obj = new Formulario($this->uri->segment(4));
				break;
			default:
				break;
		}
		if($obj != null)
			$content = $obj->getContent();
		
		
		//echo $content;
		//echo $this->uri->segment(2);
		$data['content'] = $content;
		$this->load->view(admin_template_url().'index',$data);
	}
	
	function comments() {
		
		$arr['a'] = 'oi';
		$arr['itens'] = $this->db->get('blog');
		$this->load->view('marisa',$arr);
	}
	
	function display($content = '') 
	{
		//$this->load->view('admin/index',$content);
	}
}
?>