Sunteți pe pagina 1din 1

The CheatSheet - CakePHP 1.

2
Config Model Controller View Models
Conventions
Core Properties Properties

Properties
debug $cacheQueries $recursive $action $models Class: singular, camel cased
App.encoding $data $useDbConfig Relationships $autoLayout $name
(LineItem, Person)
App.baseUrl $belongsTo $name $layout $autoRender $pageTitle
$displayField $useTable $base $params
App.dir $hasAndBelongsToMany $action $output
$id $validate $ext $plugin File: singular, underscored
Cache.check $autoLayout $pageTitle
$name $validationErrors $hasMany $hasRendered $subDir (line_item.php, person.php)
Cache.disable $autoRender $params
Acl.classname $primaryKey $_schema $hasOne $helpers $themeWeb
$base $persistModel
Acl.database $cacheAction $plugin $here $uses Table: plural, underscored
Routing.admin $layout $viewPath (line_items, people)
Methods
$components $uses
Session.start $loaded
$data $view
Session.save $helpers $viewPath
bind(params) invalidFields([data])
Session.checkAgent $here $webroot
Session.cookie create([data]) isForeignKey(field) Methods
Session.timeout delete([id, cascade]) isUnique(fields, [or]) Controllers
addScript (name, [content])
Security.level deleteAll(conditions, [cascade, callbacks]) query([sql])
element (name, [params, loadHelpers])
Security.salt escapeField(field) read([fields, id]) Methods error (code, name, message) Class: plural, camel cased,
Asset.filter.js exists() save([data, options]) ends in "Controller"
getVar (var)
Asset.filter.css constructClasses()
field(name, conditions, order) saveAll([data, options]) getVars ( ) (LineItemsController,
header(status)
find(type, [options]) saveField([name, value, validate]) renderCache ( lename, timeStart) PeopleController)
paginate ([object, scope, whitelist])
render ([action, layout, le])
Index.php getAffectedRows() schema([field]) disableCache() renderLayout(content, [layout])
getAssociated([type]) set(one, [two]) postConditions(data) File: plural, underscored
CAKE_CORE_INCLUDE_PATH set (one, [tset (one, [two]) (line_items_controller.php,
getColumnType(column) setDataSource(dataSource) redirect(url, [status])
ROOT people_controller.php)
getInsertID() setSource(tableName) referer([default, local])
WWW_ROOT
WEBROOT_DIR getNumRows() unbindModel(params, [reset]) render([action, layout, le])
hasAny([conditions]) updateAll(fields, [conditions]) set(one, [two])

Paths
hasField(name)
invalidate(field)
updateCounterCache([keys, created])
validates([options])
setAction (action, [param, param, param])
validate() Helper Properties Views
validateErrors()
APP $base $webroot Path: controller name, underscored
APP_DIR
Custom Find Types: all, first, count, list, threaded, neighbors $here $params
(app/views/line_items/<file>,
APP_PATH $action $data
app/views/people/<file>)
CACHE Callbacks Callbacks $themeWeb $plugin
CAKE $view
COMPONENTS beforeDelete() afterFind(results, primary) afterSave() File: action name, underscored
beforeFilter()
CONFIGS afterDelete() beforeValidate() beforeRender() (index.ctp, view.ctp,
CONTROLLER_TESTS beforeFind(query) beforeSave() afterFilter() Methods admin_index.ctp)
CONTROLLERS
CSS url([url, full])
ELEMENTS webroot(file)
HELPER_TESTS clean(text)

Global Functions Component


HELPERS value([field/options, field, key])
INFLECTIONS
JS Properties
LAYOUTS
$enabled Callbacks
LIB_TESTS config('fileName') __n(singular, plural, count, [return])
LIBS debug(message, [escape]) __d(domain, msg, [return]) afterRender()
LOGS beforeLayout()
Callbacks
pr(string | array | object) __dn(domain, singular, plural, count,
MODEL_TESTS e(message) [return]) afterLayout()
MODELS
h(string | array) __dc(domain, msg, category,[return]) initialize(&controller)
TESTS
am(array, [array, array]) __dcn(domain, singular, plural, startup(&controller)
TMP
cache(path, data, expires, [target]) count,category, [return]) beforeRender(&controller)
VENDORS
VIEWS clearCache([params, type, ext]) __c(msg, category, [return]) beforeRedirect(&controller)
shutdown(&controller)
env('HTTP_HEADER')
__(singular, [return])

S-ar putea să vă placă și