Re: after adding an hasOne relation to model it is not available in my view anymore
hi everyone...thx for your answers..i appreciate it
when i debug this happens
Array
(
[id] => 213
[user_id] => 1
[title] => werwr
[flyer_path] => ../lin/123/123_big.jpg
[flyer_path_thumb] => ../lin/123/123_thumb.jpg
[description] => werwrewrwerew
[created] => 2010-08-19 22:20:20
[locked] => -1
[date_locked] => 0000-00-00 00:00:00
)
it does not seem empty
i have tried it without "dependent" too...no luck!
On 20 Aug., 16:28, Dan Heberden <danheber...@gmail.com> wrote:
> Is debugging on so you can see the sql error? It's having trouble
> 'finding one' - which is one generative sql call so if IT fails the
> whole bloody thing fails and you get an empty array.
>
> On Aug 19, 2:55 pm, Marcos Mendonça <marc...@gmail.com> wrote:
>
> > have you tried without the 'dependent' => true attribute?
>
> > On Aug 19, 3:58 pm, Tomfox Wiranata <tomfox.wiran...@gmail.com> wrote:
>
> > > hi,
>
> > > weird thing. i declare a hasOne relation:
>
> > > class User extends AppModel
> > > {
> > > var $name = 'User';
>
> > > var $hasOne = array(
> > > 'Link' => array(
> > > 'className' => 'Link',
> > > 'dependent' => true
> > > )
> > > );
>
> > > }
>
> > > suddenly i am having "undefined index" everywhere i use that model in
> > > my views, like:
>
> > > <span class="profiledata"><?php echo $user['firstname']; ?></span>
>
> > > if i delete the hasOne part it works fine and the view shows the user
> > > data...what the heck did i do wrong? looking forward to your
> > > feedback..
>
> > > big big thx
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home