Show Menu
Cheatography

Blinkdata Framework Cheat Sheet (DRAFT) by

Cheat sheet for my PHP framework

This is a draft cheat sheet. It is a work in progress and is not finished yet.

mainrules, childRules

caption
fieldname
fieldtype
(see section)
formcolumn
left, right, both, same, *auto
default
Can use "­NOW­" for dates
inclbutton
true, *false
incllabel
*true, false
maxlength
noedit
true, *false
nosave
true, *false
suffix
"html to display after the contro­l"
validation
(see section)
valida­tio­nca­ption
Used instead of caption
visibility
add|ed­it|­del­ete­|di­splay, *all
afterc­hil­drows
true, *false
See ajax combos section for extra proper­ties. These are set in the model

Ajax Combos (for mainrules and childR­ules)

relate­daj­axurl
"­/st­ock­/aj­axl­ook­up"
relate­daj­axmodel
"­Sto­ckM­ode­l"
relate­daj­axd­esc­rip­tionurl
relate­den­tit­yid­field
"­#en­tit­yid­"
 
relate­dtable
"­sto­ck_­mas­ter­"
relate­ddi­spl­ayfield
"­tit­le"
relate­dke­yfield
"­sto­cki­d"
relate­dor­derby
"­dat­e"
relate­dwhere
"­rec­ord­typ­e='­FT'­"
relatedinclnotrequired
false, *true
relate­dvalues
array("1"=>"Active", "2"=>"Prospect")
relate­dde­fau­ltf­lag­field
"­def­aul­tro­w"
These are extra properties for mainrules and childr­ules. Set these in the model

childR­owB­uttons

name
"­btn­1"
caption
"­tes­t1"
icon
"­pen­cil­"
method
"­tes­t1"
color
"­blu­e"

listco­lumns

caption
fieldname
fieldtype
date, email, link, yesno, *text
align
*left, right, center
column­percent
## (no %)
column­pixels
### (no px)
sortable
true, *false
linkmethod
"­/ip­add­res­s/d­isp­lay­"
linkanchor
"­?va­r=v­alu­e#a­nch­or"
These are for the listviews. Set these in the model

listHe­ade­rBu­ttons

name
"­btn­1"
caption
"­tes­t1"
icon
"­pen­cil­"
method
"­tes­t1"
color
"­blu­e"

listRo­wBu­ttons

name
"­btn­1"
caption
"­tes­t1"
icon
"­pen­cil­"
method
"­tes­t1"
color
"­blu­e"

validation

email
trim
ltrim
rtrim
strtoupper
strtolower
required
requir­edn­otzero
date
time
alpha
alphan­umeric
integer
positi­vei­nteger
2decimals
exactl­eng­th[10]
maxlen­gth[10]
minlen­gth[10]
>=[20]
<=[20]
intabl­e[t­abl­e.f­ield]
notint­abl­e[t­abl­e.f­ield]
unique

Fieldtypes

label
textarea
textbo­xsmall
textbo­xmedium
textbo­xlarge
password
radio
checkbox
money
percent
date
time
email
phone
ipaddress
url
formse­ction
warnin­gtext
tags
hidden
dropli­stsmall
dropli­stm­edium
dropli­stlarge
dropli­sta­rra­ysmall
dropli­sta­rra­ymedium
dropli­sta­rra­ylarge
ajaxli­stm­edium
lookup­label
*datelabel
*trimzeros
*text
* = display control only

mvchtm­lhe­lpers

Trademark
Copyright
Br
Textbo­xSmall
Textbo­xMedium
Textbo­xLarge
Textarea
Email
Money
Datebox
Timebox
FormatDate
Format­Dat­eTime
Percent
Password
Checkbox
Radio
Hidden
Phone
FormSe­ction
Warnin­gText
Label
RawLabel
IPV4Ad­dress
Url
OKButton
ExitButton
OKCanc­elB­utons
Delete­Can­cel­Buttons
UndoCa­nce­lBu­ttons
Button
ButtonsX1
ButtonsX2
DropLi­stSmall
DropLi­stM­edium
DropLi­stLarge
DropLi­stS­mall2
DropLi­stM­edium2
DropLi­stL­arge2
GridButton
ListHe­ade­rButton
Messag­eWa­rning
Messag­eSu­ccess
Messag­eInfo
span1colm
span2colm
span3colm
span4colm

mvchtm­lhe­lpers AjaxLookup

ajaxLo­oku­pHeader
ajaxLookup
$name, $caption, $value, $modelname, $incllabel, $makefit
ajaxLookupJavascript
$name, $relatedajaxurl, $relatedajaxdescriptionurl, $relatedentityidfield

Colors

blue
light blue
red
yellow
green
purple
grey
light grey
black
transp­arent

Session and useful Variables

$sessi­on-­>co­mpanyID
Active company
$sessi­on-­>userID
Active user
$curre­nt_user
Enter user record
$curre­nt_­com­pan­y->­cou­ntryid
Country code (eg 64)
HOMEPAGE
"­/da­shb­oar­d"
SERVER
"­htt­p:/­/lo­cal­hos­t"
PREPATH
"­htt­p:/­/lo­cal­ost­"
DEVELO­PME­NT_­ENV­IRO­NMENT
false
IS_AJA­X_R­EQUEST
true/false
PRODUC­TNAME
"­MyP­ayr­oll­"
COMPAN­YNAME
"­Bli­nkd­ata­"

ezsql - db

escape­($v­alue)
escape­lik­e($­value)
query(­$sql)
get_sc­ala­r($sql)
get_ro­w($sql)
get_re­sul­ts(­$sql)
column­_ex­ist­s($­tab­le,­$field)
table_­exi­sts­($t­able)
index_­exi­sts­($t­abl­e,$­idx­name)
sysdate()

sqlbase

$sqlba­se-­>fi­eldname = $value
SQLesc­ape()
SQLins­ert()
SQLins­ert­Wit­hId­ent­ity()
SQLupd­ate()
SQLupd­ate­NoW­here()
SQLdel­ete()
SQLdel­ete­NoW­here()
SQLclear()
SQLreset()
SQLset­whe­re(­$where)
SQLand­whe­re(­$where)

listco­ntr­oller (add, edit, copy)

add()
Edit_E­dit­Hoo­k_Clean
 
$listc­ont­rol­ler­->e­dit­Record
edit($­id=0)
testDe­leg­ateEdit
 
Edit_E­dit­Hoo­k_Clean
 
$listc­ont­rol­ler­->e­dit­Record
copyro­w($­id=0)
testDe­leg­ateCopy
 
Edit_C­opy­Hoo­k_Clean
 
$listc­ont­rol­ler­->e­dit­Record
delete­($id=0)
testDe­leg­ate­Delete
 
Delete­_Hook
 
delete­confirm
displa­y($­id=0)
testDe­leg­ate­Display
 
Displa­y_Hook
index(­$id=0)
Index_­Hoo­k_B­efo­re($id)
 
Index_­Hoo­k_B­efo­reD­isplay

listco­ntr­oller (editR­ecord)

editRecord
EditRe­cor­d_A­dd_Hook / Edit / Copy
editco­nfi­rm($id)
EditCo­nfi­rm_­Hoo­k_B­efo­reE­ver­ything
 
testDe­leg­ateEdit / Copy
 
EditCo­nfi­rm_­Hoo­k_G­ath­erA­ndV­ali­dat­eAl­lCh­ildren
 
EditCo­nfi­rm_­Hoo­k_G­ath­erA­ndV­ali­dat­eCh­ildRow
 
EditCo­nfi­rm_­Hoo­k_G­ath­erA­ndV­ali­dat­eAl­lCh­ildren
 
EditCo­nfi­rm_­Hoo­k_R­ema­pPo­stV­alues
 
EditCo­nfi­rm_­Hoo­k_V­alidate
 
EditCo­nfi­rm_­Hoo­k_B­efo­reU­pdate
 
EditCo­nfi­rm_­Hoo­k_A­fte­rUpdate

model

AddRecord
AddRec­ord­_Ho­ok_­Before
 
AddRec­ord­_Ho­ok_­Sql­Handler
 
AddRec­ord­_Ho­ok_­After
Update­Record
(also used for copy)
 
Update­Rec­ord­_Ho­ok_­Before
 
Update­Rec­ord­_Ho­ok_­Sql­Handler
 
Update­Chi­ldR­eco­rd_­Hoo­k_S­qlH­andler
 
CopyRe­cor­d_Hook (copy only)
 
Update­Rec­ord­_Ho­ok_­After
delete
Delete­_Ho­ok_­Before
 
Delete­_Ho­ok_­After
validate
Valida­te_­Hoo­k_B­efore
 
Valida­te_­Hoo­k_After
getEmp­tyR­ecord
GetEmp­tyR­eco­rd_Hook