Use $this->Text->whatever() while in the controller and
$text->whatever() in the view.

But note that autoLinkUrls() returns the string. You'll need to modify
the value in $this->data. Either that, or use the method in your view.

On Mon, Oct 12, 2009 at 9:52 AM, Lukar Dennig <lukarden...@gmail.com> wrote:
>
> Hi everyone,
>
> im having a problem with the TextHelper and i totally dont get why...
>
> in a nutshell my controller (based on the Blog Tutorial) looks like
> this:
>
> class NewsController extends AppController {
>
>        var $name = 'News';
>        var $helpers = array('Text');
>
>        function edit($id = null) {
>                $this->News->id = $id;
>                if (empty($this->data)) {
>                        $this->data = $this->News->read();
>                } else {
>                        $text->autoLinkUrls("asd"); // (line 64)
>                        [...]
>                }
>        }
> }
>
> Now when i call the function (save the form) i get:
> "Notice (8): Undefined variable: text [APP\controllers
> \news_controller.php, line 64]"
>
> Without the line everything works. Ive been searching the cookbook for
> an hour but i cant come up with any reason. My AppController is empty
> btw. I also tried "$this->helpers[] = 'Time';" in the function but it
> didnt help.
>
> Any help would be appreciated...
>
> Lukar
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to