hello joel,
I did a little testing (php4) and it appears that as you say :
a view helper instance is not available in an element. It is of course
if you pass it as an argument of renderElement, but in this case the
variable name must be different from the helper's instance var name
(there is a recursion loop (it seems) if you do for instance $this-
>renderElement('myElement',array('pagination' => $pagination)); )
I don't ,know why it is different in php5 (according to your
testing).
I would tend to think that since elements are reusable they have to
have access to their own instance of the helpers declared in the
controller. The normal behaviour would be IMO to actually pass the
view helper instance to thee element if you need it there.
I might miss the point though and would gladly be enlightened.
On Apr 12, 11:02 pm, "joel" <[EMAIL PROTECTED]> wrote:
> I think I found a bug, but I just want to make sure that nobody else
> is having this problem.
>
> In my view I set some variables in my helper, which I need to access
> in my element. However, on PHP 4, if I have an element which accesses
> a helper, it seems to create a new instance. So, the variables I set
> in my view are no longer accessible in my element.
>
> I have tested this on PHP 5, and it doesn't have this problem. So
> it's only with PHP 4. Has anyone else experienced, this, or can you
> verify it before I submit a bug to trac?
>
> Particularly, I'm working with the PaginationHelper found in the
> Bakery (http://bakery.cakephp.org/articles/view/65), where I set the
> many variables through $pagination->setPaging($paging), but then are
> unaccessible through my pagination element.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---