http://forum.kohanaphp.com/index.php/topic,515.0.html

2008/1/31 Newton Wagner <[EMAIL PROTECTED]>:

> Pois é, mas notei algo que já me agradou. Os helpers foram
> transformados em classes estáticas: html::anchor().
>
> O exemplo talvez não tenha sido dos melhores, o cara adicionou um
> monte de código que pode ou não fazer parte da view.
>
>
> Pelo que entendi, toda essa lógica com os segmentos da URI é pra
> verificar se a página é editável ou não, isto é, se ele exibe um link
> "editar página" ou não.
>
> Não deixa de ser lógica de visualização, mas se isso se repetir em
> diversas páginas, ou ficar complexo de mais, poderia ter criado um
> helper pra auxiliar nessas tarefas. :).
>
>
> --
> Newton Wagner
>
> skype: newtonwagner
> msn/gtalk: [EMAIL PROTECTED]
>
> http://www.newtonwagner.net/blog
> - http://www.owshit.com.br/
>
>
> Em 31/01/08, Marco Telles<[EMAIL PROTECTED]> escreveu:
> > Como o outro tópico falava do CI 6 achei melhor abrir um específico.
> > Segue abaixo um pedaço de código exemplo retirado de um tutorial do site
> > Kohana. É uma view (footer.php)
> > A primeira vista, para mim olhar uma view no CI é muito mais limpo do
> > que o exemplo abaixo. Não se diz que view deve conter o mínimo (ou
> > nenhum) código ? Aqui parece que vão no sentido inverso...
> > > |<?php
> > >
> > >  $no_edit = array <http://www.php.net/array>("add", "edit",
> "details");
> > >
> > >  /* Set this page for the login redirections */
> > >  if ($this->uri->segment(1) != "user" and !in_array
> > > <http://www.php.net/in_array>($this->uri->segment(1), $no_edit))
> > >  {
> > >         $this_page = $_SERVER["REQUEST_URI"];
> > >         $this->session->set(array
> > > <http://www.php.net/array>("last_page" => $this_page));
> > >  }
> > >  if ($this->session->get("loggedin") and !in_array
> > > <http://www.php.net/in_array>($this->uri->segment(1), $no_edit))
> > >         echo <http://www.php.net/echo>
> > > html::anchor((($this->uri->rsegment(1) != '') ?
> > > $this->uri->rsegment(1) : 'page') . '/edit/' . $this->uri->segment(1)
> > > . (($this->uri->segment(2) !== false) ? ('/' . $this->uri->segment(2))
> > > : ''), 'Edit this page');
> > >
> > > ?>
> > > </div>
> > > <div id="footer">
> > >         <p>&copy; Copyright 2007 Kohana</p>
> > > </div>
> > >
> > > <?php if
> > > (!$this->session->get("loggedin")):?><h3><?=html::anchor("user/login",
> > > "LOGIN")?><?php endif; ?>
> > > <?php if
> > > ($this->session->get("loggedin")):?><h3><?=html::anchor("user/logout",
> > > "Logout")?></h3>
> > >         <h3><?=html::anchor("page/list_pages", "Page
> > > Administration")?></h3><?php endif; ?>
> > > </body>
> > > </html>|
> >
> > Abs
> >
> > --
> > Muita sorte para nós!
> >
> > Marco Telles
> >
> > #############
> > # Pier de Ipanema ( http://www.pierdeipanema.com.br/ )
> > # CodeIgniter PHP framework ( http://www.codeigniter.com.br/ )
> > # Ubuntu The power of free software ( http://www.ubuntu-br.org/ )
> > # Python Programming Language ( http://www.pythonbrasil.com.br/ )
> >
> >
> > _______________________________________________
> > Lista mailing list
> > [email protected]
> > http://codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br
> >
>
> _______________________________________________
> Lista mailing list
> [email protected]
> http://codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br
>
_______________________________________________
Lista mailing list
[email protected]
http://codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br

Responder a