<?php
Class FooHelper extends AppHelper {
        Var $helpers = array('Form','Html');

        Function testMethod()
        {
                $this->output = $this->Form->input(...);
        }
}

Remember the '$this->' 

Its not a view where it get injected as a local variable :)

---
Christian "Jippi" Winther
http://docs.cakephp.nu (Unofficial CakePHP API) 
http://logs.cakephp.nu (Unofficial CakePHP IRC log)

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: 17. juli 2007 10:22
To: Cake PHP
Subject: Helpers inside Helpers


Hi to all,

I'm writing a helper and I need to use a form helper inside this.

ex:
$this->output = $form->input('imagen', array('type' => 'file' ));

But I get the next error:
Notice (8): Undefined variable: form

I've tried to set helpers array in the beggining of the helper like:

<?php
class FilerHelper extends Helper {

    var $helpers = array('Form');
    ..
    ..
and after:
   $this->output = $form->input('imagen', array('type' => 'file' ));
or:
  $this->output = $this->form->input('imagen', array('type' =>
'file' ));

But always have an error.

I'm using the last 1.2 alpha release.

Anyone know what can i do?

Thanks for advance!
faemino.

PD: Sorrry for my poor English.




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to