Re: strange helper behaviour in element

2006-07-31 Thread Ben Durbin

Scope confusion?

The following works:

image('up.gif');
echo $html_helper->image('down.gif');
}
?>



Geoff wrote:
> When i use the html helper in an element it works fine if it is called
> directly. If, however, it is called from a function in the element, it
> does not work: "Notice: Undefined variable: html in".
>
> For example, this doesn't work:
>
>  function printUpDown() {
>   echo $html->image('up.gif');
>   echo $html->image('down.gif');
> }
> ?>
> 
> 
> 
>
> But this does:
>
> 
> image('down.gif') ?>
> 
>
> any ideas?
>
>
> >
>
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



strange helper behaviour in element

2006-07-30 Thread Geoff

When i use the html helper in an element it works fine if it is called
directly. If, however, it is called from a function in the element, it
does not work: "Notice: Undefined variable: html in".

For example, this doesn't work:

image('up.gif');
echo $html->image('down.gif');
}
?>




But this does:


image('down.gif') ?>


any ideas?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---