validation - why use the blank validator rule in the model for the ID field? cakephp -



validation - why use the blank validator rule in the model for the ID field? cakephp -

i'm new cake , want understand logic behind this. know blank rule used create sure field left blank or white space characters nowadays in it's value don't want our id equal numeric value?

when user submitting info that's used create new entry in database, don't want allow them take id. when id field blank database (or model) generate new id automatically.

usually rule used 'on' => 'create':

'id' => array( 'rule' => 'blank', 'on' => 'create' )

...which means "when creating, don't take id user." without rule user take database id or pass existing 1 , overwrite data.

validation cakephp model

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -