本文整理汇总了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);
}