oh yeah I just left my post controller as it was doh!
Thanks a lot!!
On Dec 13, 3:23 am, MrTufty <[EMAIL PROTECTED]> wrote:
> At a guess, I'd say that your /posts/index action isn't returning
> thedatacorrectly.
>
> This is roughly what it should look like: excuse the dodgy formatting.
>
> class PostsController extends AppController {
> ... snipped ...
> function index() {
> $posts = $this->Post->findAll();
> if(isset($this->params['requested']) {
> return $posts;
> }
> $this->set('posts', $posts);
> }
>
> }
>
> This means the posts index will work both if you go to it directly and
> if you use it in a requestAction.
>
> Hope that helps!
>
> Tufty
>
> On Dec 13, 5:58 am, Fabian <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I'm trying to gatherdatafrom2differentmodels(2different tables)
> > and I want to place them on my layout.
> > Ireadsomething about using a requestAction so I did the following:
>
> > function index()
> > {
> > $this->set('archives', $this->Archive->findAll());
> > $this->set('posts', $this->requestAction('/posts/index'));
>
> > }
>
> > so on my layout I have
>
> > <?php foreach ($archives as $archive): ?>
> > <input type="textbox" name="setting1" value="<?php echo
> > $archive['archive']['user']; ?>"/>
> > <?php endforeach; ?>
>
> > <?php foreach ($posts as $post): ?>
> > <input type="textbox" name="setting2" value="<?php echo
> > $post['post']
> > ['created']; ?>" />
> > <?php endforeach; ?>
>
> > the first one gets the archive user and that one works, but the second
> > one , which I used the table posts created on the 15 min tutorial
> > doesn't get thedata. Can anyone tell me what I'm doing wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---