helpers are for use in views. $html->image() is calling the image()
function of the html helper.
http://book.cakephp.org/view/205/HTML
The HtmlHelper is available in all views by default. If you're getting
an error informing you that it isn't there, it's usually due to its
name being missing from a manually configured $helpers controller
variable.
but why are you trying to output an image from your controller?
On Jul 29, 12:20 pm, Vijay Kumbhar <k.vidn...@gmail.com> wrote:
> Hello Brian,
>
> You are right,but if you are facing this problem every time then better way
> to put this code in the app_controller.php.
>
>
>
> On Wed, Jul 29, 2009 at 9:29 PM, brian <bally.z...@gmail.com> wrote:
>
> > in your controller:
>
> > public $helpers = array('Html');
>
> > On Wed, Jul 29, 2009 at 2:51 AM, Jogi Silalahi<if07...@gmail.com> wrote:
>
> > > Hai,
>
> > > i try to display image in my controller :
> > > echo $html->image("header.jpg");
>
> > > but the image cannot display, it's like my $html undefined.
> > > here the error :
> > > Notice (8): Undefined variable: html
> > > [APP\controllers\articles_controller.php, line 12]
> > > Fatal error: Call to a member function image() on a non-object in
> > > C:\AppServ\www\bv\app\controllers\articles_controller.php on line 12
>
> > > anyone can help me?
>
> > > thanks before.
>
> > > regards,
>
> > > --
> > > - Jogi Henra Ersa Silalahi -
>
> --
> Thanks & Regards,
> Vijayk.
> Co-founder (www.weboniselab.com)
>
> "You Bring the Dreams, We'll Bring the Means"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment