Saturday, February 27, 2010

Re: $webroot of helper doesn't set by App::import

If you want to send an e-mail, why are you not using the Email
component, see the CakePHP book at:
http://book.cakephp.org/view/176/Email

With that solution, you can use the whatever helper you want, without
having to import into a model!
Enjoy,
John

On Feb 27, 2:38 am, NAGATA Shinya <maya.neg...@gmail.com> wrote:
> I want to get a link to cake-app page and send it by mail.
>
> When I tried to use a Helper in Component or Controller by App:import(),
> the value of webroot is NULL.
>
> Some user try to use a Helper in a view, that rendered from
> libs/controller/pages_controller.php. This controller loads only HtmlHelper.
> When a view want to use other helpers, App::import() is called in foo.ctp.
> webroot of this helper has NULL.
>
> --
> maya
>
> On Sat, Feb 27, 2010 at 2:08 AM, John Andersen <j.andersen...@gmail.com> wrote:
> > What are you trying to do?
> > I would never use a Helper in a model, a helper is supposed to be used
> > in a View!
> > So please try to describe what you want to accomplish with a Helper in
> > the Model!
> > Enjoy,
> >   John
>
> > On Feb 26, 5:59 am, maya <maya.neg...@gmail.com> wrote:
> >> Hi,
>
> >> Im using Form helper in a Model like this.
>
> >> > App::import('Helper','Form');
> >> > $form = new FormHelper();
>
> >> But $form->webroot is NULL, it is not able to read.
> >> Is it a bug or by design?
>
> >> Thanks,
>
> >> --
> >> maya

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: