Tuesday, June 28, 2011

Re: How to get something to show onscreen

maybe a recursion problem?
bake your app without scaffolding and manually set the recursion level
(or use containable behavior)


On 27 Jun., 19:53, Magician <davis_justinmich...@yahoo.com> wrote:
> Hi.  I am new to cake php and am in the middle of making a blog.
> Right now, I am stuck on a section.  I have created two tables.  One
> for my posts and the other for tags for said posts.  The model and
> controller files are as follows:
>
> POSTS:
>
> -model:
>
> <?php
> class Post extends AppModel
> {
>         var $name='Post';
>         var $belongsTo = array('User');
>         var $hasAndBelongsToMany = array('Tag');}
>
> ?>
>
> -controller:
>
> <?php
> class PostsController extends AppController
> {
>         var $name = 'Posts';
>         var $scaffold;}
>
> ?>
>
> TAGS:
>
> -model:
>
> <?php
> class Tag extends AppModel
> {
>         var $name='Tag';
>         var $hasAndBelongsToMany=array('Post');}
>
> ?>
>
> -controller:
>
> <?php
> class TagsController extends AppController
> {
>         var $name='Tags';
>         var $scaffold;}
>
> ?>
>
> On the blog screen for making a post, there should be a listing
> showing all the tags (I currently have two already stored in the tags
> table).  However, for some reason I cannot possibly explain, the tags
> are absent.  Does anyone out there have an idea as to how to fix this?

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: