本文整理匯總了PHP中HiddenField::setId方法的典型用法代碼示例。如果您正苦於以下問題:PHP HiddenField::setId方法的具體用法?PHP HiddenField::setId怎麽用?PHP HiddenField::setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HiddenField
的用法示例。
在下文中一共展示了HiddenField::setId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct('addPhotoForm');
$language = OW::getLanguage();
// album suggest Field
$albumField = new SuggestField('album');
$albumField->setRequired(true);
$albumField->setMinChars(1);
$userId = OW::getUser()->getId();
$responderUrl = OW::getRouter()->urlFor('PHOTO_CTRL_Upload', 'suggestAlbum', array('userId' => $userId));
$albumField->setResponderUrl($responderUrl);
$albumField->setLabel($language->text('photo', 'album'));
$albumField->setId('ynmediaimporter_album_suggest');
$this->addElement($albumField);
// json hidden field
$dataField = new HiddenField('json_data');
$dataField->setId("ynmediaimporter_json_data");
$this->addElement($dataField);
$submit = new Submit('submit');
$submit->setValue("Continue");
$this->addElement($submit);
$this->setAction(OW::getRouter()->urlForRoute("ynmediaimporter.addphoto"));
}
示例2: __construct
public function __construct(BOL_AuthorizationRole $role)
{
parent::__construct('edit-role-form');
$this->setAjax(true);
$this->setAction(OW::getRouter()->urlFor('ADMIN_CTRL_Users', 'ajaxEditRole'));
$roleId = new HiddenField('roleId');
$roleId->setValue($role->id);
$this->addElement($roleId);
$displayLabel = new CheckboxField('displayLabel');
$displayLabel->setValue($role->displayLabel);
$this->addElement($displayLabel);
$color = new HiddenField('labelColor');
$color->setValue(!empty($role->custom) ? $role->custom : '#999999');
$color->setId('label-color-field');
$this->addElement($color);
$submit = new Submit('save');
$this->addElement($submit);
$js = 'owForms["' . $this->getName() . '"].bind("success", function(data){
if ( data.error != undefined ){
OW.error(data.error);
}
if ( data.message != undefined ){
OW.info(data.message);
}
document.location.reload();
});';
OW::getDocument()->addOnloadScript($js);
}