Thanks John,
Thats probably the right way to takle this.
i do have a problem with the multidimensional array i get from the
database.
a.i.
[controler]
function index(){
// SET UP DATABASE DATA
$this->set('posts', $this->Post->findAll());
}
[/controler]
[view]
<?php
foreach($posts as $post):
$this->renderElement('post', $posts);
endforeach;
?>
[/view]
How would i talke this?
Thanks!
Auke.
On Oct 2, 4:57 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Oct 2, 2007, at 8:49 AM, Auke wrote:
>
>
>
> > Hi guys,
>
> > I have just started yesterday using cakePhp.
> > I'm vamiliar with frameworks and always have used CodeIgniter.
> > Now i have to use cakePhp because the company i will work for is using
> > that.
>
> > and now the question i have:
>
> > I want to minimize the php code i use in my views by using chunks.
> > <snip>
> > So... how would i inserts chunks of code in a view file with cakePhp.
>
> Use Elements:
>
> Stick your view code in a file in /app/views/elements/whatever.ctp.
>
> In a view where you want to utilize this "chunk" of view code, use
> the renderElement() function.
>
> http://api.cakephp.org/1.2/
> class_view.html#5f5c0cc6e03b3a856a96979f05233d61
>
> -- John
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---