cakephp_cakesheet.pdf
(
374 KB
)
Pobierz
332049378 UNPDF
CakePHP Naming Conventions
Global Functions
Models
Controllers
Views
config ('file_name')
uses ('file_name')
vendor ('file_name')
debug ('message')
a (element, [element, element])
aa (key, value, [key, value])
e ('message')
low ('STRING')
up ('string')
r ('search', 'replace', 'text')
pr (array)
am (array, [array, array])
env ('HTTP_HEADER')
cache (path, data, expires, [target])
clearCache ([params, type, ext])
countdim (array)
Class Name: singular, camel cased
(LineItem, Person)
Class Name: plural, camel cased,
ends in "Controller"
(LineItemsController, People Controller)
Path: controller name, underscored
(app/views/line_items/<file>, app/
views/people/<file>)
File Name: singular, underscored
(line_item.php, person.php)
File Name: plural, underscored
(line_items_controller.php,
people_controller.php)
Table Name: plural, underscored
(line_items, people)
File Name: action name, lowercase
(index.thtml, view.thtml)
Model
Controller
View
Properties
Properties
Properties
$cacheQueries
$data
$displayField
$recursive
$useDbConfig
$useTable
$validate
$validationErrors
Association Properties
$name
$action
$action
$autoLayout
$belongsTo
$autoLayout
$autoRender
$autoRender
$base
$hasAndBelongsToMany
$hasMany
$hasOne
$base
$beforeFilter
$controller
$ext
$id
$name
$primaryKey
$cacheAction
$components
$hasRendered
$helpers
$data
$helpers
$here
$layout
$_tableInfo
$here
$layout
$loaded
$models
Methods
$output
$pageTitle
$name
$pageTitle
$params
$persistModel
$params
$parent
bindModel (params)
create ( )
delete (id, [cascade])
escapeField (field)
execute (data)
exists ( )
field (name, conditions, order)
find ([conditions, fields, order, recursive])
findAll ([conditions, fields, order, limit, page, recur...])
findAllThreaded([conditions, fields, sort])
findCount ([conditions, recursive])
findNeighbours (conditions, field, value)
generateList ([conditions, order, limit, keyPath, val...])
getA
f
ectedRows ( )
getColumnType (column)
getColumnTypes ( )
getDisplayField ( )
getID ([list])
getLastInsertID ( )
$plugin
$subDir
$plugin
$uses
getNumRows ( )
hasAny ([conditions])
hasField (name)
invalidate (field)
invalidFields ([data])
$view
$viewPath
$themeWeb
$uses
$webroot
$viewPath
Methods
Methods
cleanUpFields ( )
constructClasses ( )
flash (message, url, [pause])
flashOut (message, url, [pause])
generateFieldNames (data, doCreateO...)
postConditions (data)
redirect (url, [status])
referer ([default, local])
render([action, layout, file])
set (one, [two])
setAction (action, [param, param, param])
validate ( )
validateErrors ( )
element (name)
error (code, name, message)
pluginView (action, layout)
render ([action, layout, file])
renderCache (filename, timeStart)
renderElement (name, [params])
renderLayout (content_for_layout)
setLayout (layout)
isForeignKey (field)
loadInfo ( )
query ([sql])
read ([fields, id])
remove ([id, cascade])
save ([data, validate, fieldList])
saveField ([name, value, validate])
set (one, [two])
setDataSource (dataSource)
setSource (tableName)
unbindModel (params)
validates ([data])
Helper
Callbacks
Availability: View only
Callbacks
beforeDelete ( ) afterDelete ( )
beforeFind (&qu..) afterFind (results)
beforeSave ( )
afterSave ( )
Properties
beforeFilter ( )
beforeRender ( )
beforeValidate ( )
$tags
afterFilter ( )
$base
Global Constants
$here
$action
$themeWeb
Core Defines
Component
Paths
$view
ACL_CLASSNAME
ACL_FILENAME
AUTO_SESSION
CACHE_CHECK
APP
INFLECTIONS
JS
LAYOUTS
LIB_TESTS
LIBS
LOGS
CAKE_SESSION_STRING
CAKE_SESSION_TABLE
CAKE_SESSION_TIMEOUT
COMPRESS_CSS
DEBUG
LOG_ERROR
Availability: Controller / View
$webroot
APP_DIR
APP_PATH
CACHE
CAKE
COMPONENTS
CONFIGS
CONTROLLER_TESTS
CONTROLLERS
CSS
ELEMENTS
HELPER_TESTS
HELPERS
Properties
$params
$data
$disableStartup
$plugin
CAKE_ADMIN
Callbacks
CAKE_SECURITY
startup (&controller)
Callbacks
afterRender ( )
CAKE_SESSION_COOKIE
MAX_MD5SIZE
MODEL_TESTS
Conventions
CAKE_SESSION_SAVE
WEBSERVICES
MODELS
SCRIPTS
TESTS
TMP
Class Name:
MyCoolComponent
Path: app/controllers/components/
my_cool.php
Conventions
Class Name:
MyCoolHelper
Path: app/views/helpers/
my_cool.php
Webroot Configurable Paths
CORE_PATH
ROOT
WWW_ROOT
WEBROOT_DIR
CAKE_CORE_INCLUDE_PATH
Usage
VENDORS
Controller:
$this->MyCool->method( );
View:
$this->controller->MyCool->method( );
Usage
View: $myCool->method( );
VIEWS
Copyright © 2006, Cake Software Foundation
Plik z chomika:
cms-world
Inne pliki z tego folderu:
php5.pdf
(266 KB)
cake_cakesheet1.pdf
(374 KB)
cakephp_world%20domination.talk.pdf
(7668 KB)
cakephp_os-php-cake4-a4.pdf
(238 KB)
cakephp_OpenSeminar2007Ohgaki.pdf
(665 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin