Thursday, November 29, 2012

Re: Including an External Library file that has functions that aren't in a class?

Might it be better to create a component? You could have AppController
load it so that it's always available.

On Wed, Nov 28, 2012 at 10:20 PM, bluesclues9 <bluesclues9@gmail.com> wrote:
> Hi
> I ran into a similar situation in which I need to write up my own functions
> that are to be used in multiple views(jquery calls). For example: I need to
> check existence of a file in my file library and I need to do this in
> multiple controllers.
>
> I am thinking of writing commonly used functions in a php file and use them
> in jquery calls.
>
> Would you let me know how I do that?
>
> I tried creating a php file called myutil.php and kept it under /app/libs
> folder.
> I have also added this in app_controller.php as App::Import('Lib',
> 'myutil');
>
> However, when I made a call to this, I was getting errors like
> myutil.phpController does not exist under app/controllers.
>
> Where am I going wrong with this?
>
> -Sri Adhi
>
>
>
>
> --
> View this message in context: http://cakephp.1045679.n5.nabble.com/Including-an-External-Library-file-that-has-functions-that-aren-t-in-a-class-tp1331401p5712490.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.

No comments: