o install.php estar recuperado podem ver.

www.guianois.com.br


seque um exemplo dos meus controles:


<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Categoria
 *
 * @author Antoniel
 */

defined('SYSPATH') OR die('No Direct Script Access');

class Controller_Index extends Controller_Template {
    //put your code here
    public $template = 'index';

    function head() {

        $this->template->title           = "Portal - Estabelecimento";
        $this->template->styles          = array('css/style.css');
        $this->template->scripts         = array(

'js/jquery-1.6.2.min.js',

                                                    'js/menu.js'
                                                );

        $this->template->categorias = ORM::factory('Categoria')->find_all();
        $this->template->conteudo = "";

    }

    public function action_index()
    {
        $this->head();
        $this->template->render();
    }

    public function action_teste()
    {
        echo Kohana::$base_url;
    }
    public function action_salvar() {

        $estabelecimento = new Model_Estabelecimento();
        $this->read($estabelecimento);
        $estabelecimento->save();

        $logo = $_FILES["logo"];
        move_uploaded_file($logo["tmp_name"],
'logos/'.$estabelecimento->id.'.png');
        $this->head($estabelecimento);


    }

    public function action_editar($id) {

        $estabelecimento = ORM::factory('Estabelecimento',$id);
        $this->read($estabelecimento);
        $estabelecimento->update();
        $logo = $_FILES["logo"];
        move_uploaded_file($logo["tmp_name"],
'logos/'.$estabelecimento->id.'.png');
        $this->head($estabelecimento);

    }

    public function action_find($id) {

        $estabelecimento = ORM::factory('Estabelecimento',$id);

        $this->head($estabelecimento);

    }


    public function action_show($id) {

        $post = ORM::factory('Post',$id);
        //print_r($post);
        $this->template->post = $post;
        $this->head();
        $this->template->conteudo = 'post/post_view.php';
        //$this->template->render();

    }

    function read($estabelecimento) {

        $estabelecimento->nome = $_POST['nome'];
        $estabelecimento->site = $_POST['site'];
        $estabelecimento->email = $_POST['email'];
        $estabelecimento->telefone = $_POST['telefone'];
        $estabelecimento->cnpj = $_POST['cnpj'];
        $estabelecimento->ie = $_POST['ie'];
        $estabelecimento->bairro = $_POST['bairro'];
        $estabelecimento->endereco = $_POST['endereco'];
        $estabelecimento->numero = $_POST['numero'];
        $estabelecimento->artigo = $_POST['artigo'];
        $estabelecimento->categoria = ORM::factory('Categoria',
$_POST['categoria']);

    }
}

?>

-- 
Você está recebendo esta mensagem porque se inscreveu no grupo "Kohana Php" dos 
Grupos do Google.
Para postar neste grupo, envie um e-mail para [email protected].
Para cancelar a inscrição nesse grupo, envie um e-mail para 
[email protected].
Para obter mais opções, visite esse grupo em 
http://groups.google.com/group/kohana-php?hl=pt-BR.

Responder a