On Sat, Mar 12, 2011 at 6:39 PM, Chris <[email protected]> wrote: > I have a single post I want to load for my website. > I made a controller function > > function homeview(){ > $this->ParentcornerPost->recursive = -1; > $this->set('posts',$this->ParentcornerPost- >>find('first',array(null,null,'date DESC'))); > $this->render(array('view_ajax','ajax')); > } > > I also made a view called view_ajax.ctp > > <h3>Parent's Corner-Ajax loaded</h3> > <?php > echo $this->Html->para("post",$parentcornerPost['ParentcornerPost'] > ['content']); > echo $this->Html->para("date",$this->Time- >>timeAgoInWords($parentcornerPost['ParentcornerPost']['date'])); > ?> > > And then I tried to load that view on a page with this code > > <div id="parentscorner" class="parentscorner"> > <h3>Parent's Corner</h3> > <p>Loading Ajax View...</p> > <?php $this->Ajax->remoteFunction(array('url' => > array('controller'=>'ParentcornerPosts', > 'action'=>'homeview'),'update'=>'parentscorner'));?> > <p><?php echo $this->Html->link("All Parent's Corner Posts", > array("controller"=>"parentcornerPosts","action"=>"index",null)); ?></ > p> > </div> > > > BUT ITS NOT WORKING!!! AHHH! And I can't find any function in CakePHP > that would do what I needed.
Look into using elements and requestAction(). I don't use the AjaxHelper so can't comment on that. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
