drupal - Node edit form: edit or new state? -


what's best way of figuring out if node form in create new node state or edit existing node state?

is there in $form array or have kludge arg()?

are asking node edit form? if so, can either following:

if (empty($form['nid']['#value'])) {   // in add form } else {   // in edit form } 

or...

if (arg(1) == "add") {   // in add form... } else {   // in edit form... } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -