Cakephp Classroom image

osdyui
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|Last
Lessons:-Core Libraries

constant YEAR
Equals 31536000
App Class
class App
The app class is responsible for path management, class location and class loading. Make sure you follow
the File and Classname Conventions.
Packages
CakePHP is organized around the idea of packages, each class belongs to a package or folder
where other classes reside. You can configure each package location in your application using
App::build(’APackage/SubPackage’, $paths) to inform the framework where should each
class be loaded. Almost every class in the CakePHP framework can be swapped with your own compatible
implementation. If you wish to use you own class instead of the classes the framework provides, just add
the class to your libs folder emulating the directory location of where CakePHP expects to find it.
For instance if you’d like to use your own HttpSocket class, put it under:
app/Lib/Network/Http/HttpSocket.php
Once you’ve done this App will load your override file instead of the file inside CakePHP.
Loading classes
static App::uses(string $class, string $package)
Return type void
Classes are lazily loaded in CakePHP, however before the autoloader can find your classes you need
to tell App, where it can find the files. By telling App which package a class can be found in, it can
properly locate the file and load it the first time a class is used.
Some examples for common types of classes are:
Controller App::uses(’PostsController’, ’Controller’);
Component App::uses(’AuthComponent’, ’Controller/Component’);
Model App::uses(’MyModel’, ’Model’);
Behaviors App::uses(’TreeBehavior’, ’Model/Behavior’);
Views App::uses(’ThemeView’, ’View’);
Helpers App::uses(’HtmlHelper’, ’View/Helper’);
Libs App::uses(’PaymentProcessor’, ’Lib’);
Vendors App::uses(’Textile’, ’Vendor’);

 
 
 

osdyui

Skills    Cakephp

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)