Q:

How to create my own library on CakePHP

I am new to cakephp and I managed to work my way out doing some great stuff with this powerful framewoek. Seeking some organization in my code, I am looking for a way to create some kind of  side library to call it whenever it.
I am working on the mailing layer of my application using the built in mailing utility, so I want to know how to create a library where i can store my functions.
Thank you.

A:

you can create your own library file in 

/app/Lib/Library_Class_name.php
  

class Library_Class_name {
   public function function_name() {

   }
}

after this you should need to use load this Library file to your application  use below code 

App::uses('Library_Class_name', 'Lib');

One this, If you want to load this file for entire application you need to use above App::uses code to your Config/bootstrap.php file otherwise you can use this to needed files or functions.

