Re: Functions in View could not able to load Helpers?

2010-07-01 Thread Nabil Alsharif
Or if you want to be stylish about it make a new helper class with your function in it and add 'Html' to the $helpers array: class MyHelper extends AppHelper { var $helpers = array('Html'); function my_function(){ On Thu, Jul 1, 2010 at 2:04 PM, Miles J wrote: > Because $html is not a

Re: Functions in View could not able to load Helpers?

2010-07-01 Thread Miles J
Because $html is not a global variable, its restricted to the scope of the view rendering process. You need to pass it as an argument. On Jul 1, 4:46 am, saidbakr wrote: > So why global does not work? > > for example: > function foo(){ > global $html; > > } > > On Jul 1, 12:22 pm, "Dr. Loboto"

Re: Functions in View could not able to load Helpers?

2010-07-01 Thread saidbakr
So why global does not work? for example: function foo(){ global $html; } On Jul 1, 12:22 pm, "Dr. Loboto" wrote: > You need to pass these variables into function. > > On Jul 1, 2:57 am, saidbakr wrote: > > > Sorry, it was just typing mistake. I already write it with brckets - > > notice the cl

Re: Functions in View could not able to load Helpers?

2010-07-01 Thread Dr. Loboto
You need to pass these variables into function. On Jul 1, 2:57 am, saidbakr wrote: > Sorry, it was just typing mistake. I already write it with brckets - > notice the closing bracket -. > > I still don't know how to make Html helper accessible inside the > function. > > On Jun 30, 7:33 pm, Shaz

Re: Functions in View could not able to load Helpers?

2010-06-30 Thread saidbakr
Sorry, it was just typing mistake. I already write it with brckets - notice the closing bracket -. I still don't know how to make Html helper accessible inside the function. On Jun 30, 7:33 pm, Shaz wrote: > .$html->link[$catName, > > You're using a square bracket? Should be: > > .$html->link($c

Re: Functions in View could not able to load Helpers?

2010-06-30 Thread Shaz
.$html->link[$catName, You're using a square bracket? Should be: .$html->link($catName, On Jun 30, 5:13 pm, saidbakr wrote: > Hi, > I have a little function in one of my views. This function could not > able to use helpers. For example: > > //add.ctp > > // some html > function printCat(){ > >

Functions in View could not able to load Helpers?

2010-06-30 Thread saidbakr
Hi, I have a little function in one of my views. This function could not able to use helpers. For example: //add.ctp // some html '.$html->link[$catName, array('controller'=>'categories','action'=>'view','id'=>$catId)).''; } ?> I don't know how could I able to make the html helper accessible by