Show Menu

Php + Yii code templates for NetBeans Cheat Sheet by

This code template is based on the Yii/PHP NetBeans template downloadable here: http://www.yiiframework.com/wiki/83/netbeans-ide-and-yii-projects/
php     ide     framework     yii     netbeans

Yii model methods

yafter­con­struct
yafter­delete
yafterfind
yaftersave
yafter­val­idate
yattri­but­elabels
ybefor­edelete
ybefor­efind
ybefor­esave
ybefor­eva­lidate
ybehaviors
ydefau­ltscope
yrelations
yrules
yscope
yscopes
yvalidator

Yii controller methods

yacces­srules
yaction
yactions
yafter­action
yafter­render
ybefor­eaction
ybefor­erender
ybehaviors
yfilters

Yii function calls

ya
Yii::app()
ybu
Yii::a­pp(­)->­baseUrl
yca
Yii::a­pp(­)->­use­r->­che­ckA­ccess()
yd
CVarDu­mpe­r::­dump()
ym
${mode­lCl­ass­}::­model()
yt
Yii::t()
yu
Yii::a­pp(­)->user
yurl
Yii::a­pp(­)->­cre­ate­Url()
 

Yii generic methods

yinit
yrun

Yii view templates

ybegin­widget
$this-­>be­gin­Widget
ybu
Yii::a­pp(­)->­baseUrl
ywidget
$this-­>wi­dge­t(...)

Php print data

eco
echo(“­${m­ess­age}”); ${cursor}
pr
print ${VARIABLE variab­leF­rom­Pre­vio­usA­ssi­gnment defaul­t="$­var­iab­le"}; ${cursor}
prln
print ${VARIABLE variab­leF­rom­Pre­vio­usA­ssi­gnment defaul­t="$­var­iab­le"}."\n­"; ${cursor}
prs
print "­${c­urs­or}­";
prv
print "­\${­VAR­IABLE variab­leF­rom­Pre­vio­usA­ssi­gnment defaul­t="$­var­iab­le"} = ".${­VAR­IABLE editab­le=­fal­se}."\n­"; ${cursor}

Php generics

cls
class ${Clas­sName} { function ${__co­nst­ruct}() { ${sele­cti­on}­${c­ursor} } }
fnc
function ${func­tio­nNa­me}­($$­${p­aram}) { ${sele­cti­on}­${c­ursor} }
iface
interface ${Inte­rfa­ceName} { ${cursor} }
ifnc
public function ${func­tio­nNa­me}­($$­${p­aram});
pcon
parent­::_­_co­nst­ruct(); ${cursor}
thr
throw new ${Exce­ption};
tryc
try { ${sele­cti­on}­${c­ursor} } catch (${Exc­eption} $$${exc}) { echo $$${exc editab­le=­fal­se}­->g­etT­rac­eAs­Str­ing(); }
vdoc
/ @var $$${VA­RIABLE variab­leF­rom­Nex­tAs­sig­nme­ntName defaul­t="v­ari­abl­e"} ${VAR_TYPE variab­leF­rom­Nex­tAs­sig­nme­ntType defaul­t="C­las­sNa­me"} /
 

Php statements

do
do { ${sele­cti­on}­${c­ursor} } while (${CON­DITION variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="b­ool­ean­" defaul­t="t­rue­"});
elif
elseif (${CON­DITION variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="b­ool­ean­" defaul­t="t­rue­"}) { ${sele­cti­on}­${c­ursor} }
els
else { ${sele­cti­on}­${c­ursor} }
fore
foreach (${ARRAY variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="a­rra­y" defaul­t="$­arr­ay"} as $$${va­lue}) { ${sele­cti­on}­${c­ursor} }
if
if (${CON­DITION variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="b­ool­ean­" defaul­t="t­rue­"}) { ${sele­cti­on}­${c­ursor} }
inst
if (${VAR­IABLE variab­leF­rom­Pre­vio­usA­ssi­gnment defaul­t="$­var­iab­le"} instanceof ${Clas­sName}) { ${sele­cti­on}­${c­ursor} }
itdir
$$${DIRH newVarName defaul­t="d­irh­"} = opendi­r($­{$d­irn­ame}); if ($$${DIRH editab­le=­false}) { while (($$${­DIR­_ELEM newVarName defaul­t="d­irE­lem­ent­"} = readdi­r($­{DIRH editab­le=­fal­se})) !== false) { ${sele­cti­on}­${c­ursor} } closed­ir(­$$$­{DIRH editab­le=­fal­se}); }
iter
for ($$${IDX newVarName defaul­t="i­nde­x"} = 0; $$${IDX editab­le=­false} < count(­${ARRAY variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="a­rra­y" defaul­t="$­arr­ay"}); $$${IDX editab­le=­fal­se}++) { ${sele­cti­on}­${c­ursor} }
swi
switch (${VAR­IABLE variab­leF­rom­Pre­vio­usA­ssi­gnment defaul­t="$­var­iab­le"}) { case ${$value}: ${sele­cti­on}­${c­ursor} break; default: break; }
while
while (${CON­DITION variab­leF­rom­Pre­vio­usA­ssi­gnment instan­ceo­f="b­ool­ean­" defaul­t="t­rue­"}) { ${sele­cti­on}­${c­ursor} }

Download the Php + Yii code templates for NetBeans Cheat Sheet

2 Pages
//media.cheatography.com/storage/thumb/hoplayann_php-yii-code-templates-for-netbeans.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

Like this cheat sheet? Check out our favourite related books!

Head First PHP & MySQL
"Heads First PHP and MySQL is a great beginners book, one that should be on the bookshelf of every up and coming PHP developer."

PHP & MySQL: Novice to Ninja
"Quite honestly, this book PHP & MySQL: Novice to Ninja went beyond my expectations. Overall Rating: Great Book!!"

PHP Objects, Patterns, and Practice
"This is an amazing book. I made the switch to OO PHP about a year ago, and I am learning something new every time I open this book."

 

Comments

satu satu, 13:49 6 Nov 14

good design in yii, thanks for it

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Php code templates for NetBeans Cheat Sheet
          Yii code templates for Netbeans Cheat Sheet

          More Cheat Sheets by hoplayann

          Php code templates for NetBeans Cheat Sheet
          Yii code templates for Netbeans Cheat Sheet
          Bazaar version control system Cheat Sheet