CakePHP 1.3 helper and variable name collision.
I thought in CakePHP 1.3 the issue with helpers and variables
colliding had been resolved. However, in the below view code the
gettype function outside of the loop references the ArtistHelper
correctly (returns "object"), and inside refers to the $artist
variable (returns "array").
<?php
echo gettype($this->Artist);
foreach($artists as $artist) {
echo gettype($this->Artist);
$url = $this->Artist->url($artist['Artist']['slug']);
}
?>
I would rather avoid a different name for the variable, as "artist" is
the most descriptive name. Has this not been resolved, or am I doing
something wrong?
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