Cheatography
https://cheatography.com
This code template is based on the Yii/PHP NetBeans template downloadable here: http://www.yiiframework.com/wiki/83/netbeans-ide-and-yii-projects/
Yii model methods
yafterconstruct |
yafterdelete |
yafterfind |
yaftersave |
yaftervalidate |
yattributelabels |
ybeforedelete |
ybeforefind |
ybeforesave |
ybeforevalidate |
ybehaviors |
ydefaultscope |
yrelations |
yrules |
yscope |
yscopes |
yvalidator |
Yii controller methods
yaccessrules |
yaction |
yactions |
yafteraction |
yafterrender |
ybeforeaction |
ybeforerender |
ybehaviors |
yfilters |
Yii function calls
ya |
Yii::app() |
ybu |
Yii::app()->baseUrl |
yca |
Yii::app()->user->checkAccess() |
yd |
CVarDumper::dump() |
ym |
${modelClass}::model() |
yt |
Yii::t() |
yu |
Yii::app()->user |
yurl |
Yii::app()->createUrl() |
|
|
Yii view templates
ybeginwidget |
$this->beginWidget |
ybu |
Yii::app()->baseUrl |
ywidget |
$this->widget(...) |
Php print data
eco |
echo(“${message}”); ${cursor} |
pr |
print ${VARIABLE variableFromPreviousAssignment default="$variable"}; ${cursor} |
prln |
print ${VARIABLE variableFromPreviousAssignment default="$variable"}."\n"; ${cursor} |
prs |
print "${cursor}"; |
prv |
print "\${VARIABLE variableFromPreviousAssignment default="$variable"} = ".${VARIABLE editable=false}."\n"; ${cursor} |
Php generics
cls |
class ${ClassName} { function ${__construct}() { ${selection}${cursor} } } |
fnc |
function ${functionName}($$${param}) { ${selection}${cursor} } |
iface |
interface ${InterfaceName} { ${cursor} } |
ifnc |
public function ${functionName}($$${param}); |
pcon |
parent::__construct(); ${cursor} |
thr |
throw new ${Exception}; |
tryc |
try { ${selection}${cursor} } catch (${Exception} $$${exc}) { echo $$${exc editable=false}->getTraceAsString(); } |
vdoc |
/ @var $$${VARIABLE variableFromNextAssignmentName default="variable"} ${VAR_TYPE variableFromNextAssignmentType default="ClassName"} / |
|
|
Php statements
do |
do { ${selection}${cursor} } while (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}); |
elif |
elseif (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { ${selection}${cursor} } |
els |
else { ${selection}${cursor} } |
fore |
foreach (${ARRAY variableFromPreviousAssignment instanceof="array" default="$array"} as $$${value}) { ${selection}${cursor} } |
if |
if (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { ${selection}${cursor} } |
inst |
if (${VARIABLE variableFromPreviousAssignment default="$variable"} instanceof ${ClassName}) { ${selection}${cursor} } |
itdir |
$$${DIRH newVarName default="dirh"} = opendir(${$dirname}); if ($$${DIRH editable=false}) { while (($$${DIR_ELEM newVarName default="dirElement"} = readdir(${DIRH editable=false})) !== false) { ${selection}${cursor} } closedir($$${DIRH editable=false}); } |
iter |
for ($$${IDX newVarName default="index"} = 0; $$${IDX editable=false} < count(${ARRAY variableFromPreviousAssignment instanceof="array" default="$array"}); $$${IDX editable=false}++) { ${selection}${cursor} } |
swi |
switch (${VARIABLE variableFromPreviousAssignment default="$variable"}) { case ${$value}: ${selection}${cursor} break; default: break; } |
while |
while (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { ${selection}${cursor} } |
|
Created By
Metadata
Favourited By
Comments
satu 13:49 6 Nov 14
good design in yii, thanks for it
Add a Comment
Related Cheat Sheets
More Cheat Sheets by [deleted]