cakephp

Page 84

Chapter 11. Cake's Global Constants And Functions Here are some globally available constants and functions that you might find useful as you build your application with Cake.

11.1. Global Functions Here are Cake's globally available functions. Many of them are convenience wrappers for long-named PHP functions, but some of them (like vendor() and uses()) can be used to include code, or perform other useful functions. Chances are if you're wanting a nice little function to do something annoying over and over, it's here. config(); ; Loads Cake's core configuration file. Returns true on success. uses($lib1, $lib2...); string $lib1; string $lib2...; Used to load Cake's core libaries (found in cake/libs/). Supply the name of the lib filename without the '.php' extension. uses('sanitize', 'security');

vendor($lib1, $lib2...); string $lib1; string $lib2...; Used to load external libraries found in the /vendors directory. Supply the name of the lib filename without the '.php' extension. vendor('myWebService', 'nusoap');

debug($var, $showHtml = false); mixed $var; boolean $showHtml = false; If the application's DEBUG level is non-zero, the $var is printed out. If $showHTML is true, the data is rendered to be browser-friendly. a(); 74


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.