or   Register or Register today to make and share your own cheat sheets! (Why Join?)

Cheatography Login

Join Us!

Not a Cheatographer? Register here!

Social Media

You can login to or register with Cheatography using your Facebook or Twitter account!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

Php + Yii code templates for NetBeans Cheat Sheet by hoplayann

Comments   |   Add a Comment   |   PDF Download   |   Find:

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} }

Favourited by 2 Members:

hoplayann Dranzz

Comments

No comments yet. Add yours below!

Add a Comment

Comment:

Contents

This code template is based on the Yii/PHP NetBeans template downlo­adable here: http:/­/ww­w.y­iif­ram­ewo­rk.c­om­/wi­ki/­83/­net­bea­ns-­ide­-an­d-y­ii-­pro­jects/

Column Content Comments Author Updated
- Php + Yii code templates for NetBeans Cheat Sheet hoplayann 11 Feb 13
1 Yii model methods 0 hoplayann 11 Feb 13
Yii controller methods 0 hoplayann 11 Feb 13
Yii function calls 0 hoplayann 11 Feb 13
2 Yii generic methods 0 hoplayann 11 Feb 13
Yii view templates 0 hoplayann 11 Feb 13
Php print data 0 hoplayann 11 Feb 13
Php generics 0 hoplayann 11 Feb 13
3 Php statements 0 hoplayann 11 Feb 13