Tester.php is a file with a regular php function I want available to
view/tester/index.thtml
And also need to call it from the TestController Class...
controller/tester_controller.php...can call it from view/tester/
index.thtml ok with a
include "tester.php"
but can' seem to get to the function from controller/tester.php
Thanks for your reply.

On Jan 16, 12:43 pm, brian <[email protected]> wrote:
> What do you mean by, "view controller"? It appears to me that
> TesterController is a "controller". There doesn't seem to be any view
> involved here.
>
> What is tester.php? Is it your model class?
>
> If testCall is just a function you want globally available, you can
> put it in bootstrap.php. If you need something much more complex,
> consider creating a Vendor class.
>
> On Fri, Jan 16, 2009 at 3:33 PM, [email protected]
>
>
>
> <[email protected]> wrote:
>
> > Can I call a function from a php file from a view controller? I tried
> > it with an include and it didn't work...Here is a sample of what I
> > want...
>
> > // File tester.php
> > <? function testCall ()
> > { return 100;}
> > ?>
>
> > // File view controller
> > <?php
> > class TesterController extends AppController
> > {
>
> >     function index()
> >     {
> >          $x = testCall();
> >     }
> > }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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