Tuesday, September 21, 2010

Re: Wrapper function aa unavailable in models?

This is a PHP restriction. You can not use functions within class
properties.

Furthermore, do not use "aa" or any other convenience function as they
are being removed.

On Sep 21, 10:32 am, "Evan R. Murphy" <evanrmur...@gmail.com> wrote:
> This model code using array works:
>
> <?
> class Foo extends AppModel {
>   var $name = 'Foo';
>   var $actsAs = array(
>     'Tree' => array(
>       'parent' => 'ParentID')); } ?>
>
> When I try using wrapper function aa instead, Cake complains "Parse
> error: syntax error, unexpected '(', expecting ',' or ';' in foo.php
> on line 4":
>
> <?
> class Foo extends AppModel {
>   var $name = 'Foo';
>   var $actsAs = aa(
>     'Tree', aa(
>       'parent', 'ParentID')); } ?>
>
> aa works in my controllers no problem. Is aa not available for use in
> Cake models?

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


Real Estate