本文整理匯總了PHP中HiddenField::name方法的典型用法代碼示例。如果您正苦於以下問題:PHP HiddenField::name方法的具體用法?PHP HiddenField::name怎麽用?PHP HiddenField::name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HiddenField
的用法示例。
在下文中一共展示了HiddenField::name方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($name = 'form', $externalForm = false)
{
$this->name = $name;
$this->externalForm = $externalForm;
if (!$externalForm) {
$this->add(HiddenField::name($this->name . "_is_submitted")->value(1)->required(true));
}
}
示例2: _createAddCommentForm
function _createAddCommentForm($content_id, $content_type)
{
$form = new Form();
$form->action = "/comment/add";
$form->submitText = "Add Comment";
$form->add(HiddenField::name('content_id')->value($content_id));
$form->add(HiddenField::name('content_type')->value($content_type));
$form->add(TextareaField::name('comment')->required(true)->width('50%')->rows(3));
return $form;
}
示例3: __construct
public function __construct($name = 'form', $externalForm = false)
{
$this->name = $name;
$this->externalForm = $externalForm;
if (!$externalForm) {
// Submission token in case of multiple forms
$this->add(HiddenField::name($this->name . "_is_submitted")->value(1)->required(true));
// CSRF token
$this->add(CSRFTokenField::name("CSRFToken")->value($_SESSION['CSRFToken'])->required(true));
}
}
示例4: _createLoginForm
public function _createLoginForm()
{
$form = new Form("login");
$form->action = "/login";
if (!$this->args('username')) {
$username = '';
} else {
$username = $this->args('username');
}
$form->add(HiddenField::name('action')->value('login')->required(true));
$form->add(TextField::name('username')->label('Username')->value($username)->required(true));
$form->add(PasswordField::name('password')->label('Password')->required(true));
$form->add(CheckboxField::name('remember_me')->label("Remember me on this computer.")->checked(true));
$form->setSubmitText("Sign into your account");
$form->setSubmitClass("btn btn-primary btn-large");
return $form;
}
示例5: createFileForm
/**
* @return Form
*/
private function createFileForm()
{
/** @var Form $form */
$form = new Form('file', true);
/** @var StorageInterface $file */
$file = Storage::newFile();
$fields = $file->getUploadFields();
foreach ($fields as $name => $value) {
$form->add(HiddenField::name($name)->value($value));
}
$form->add(UploadField::name("file"));
$form->setSubmitText("Upload File");
$form->action = $file->getUploadURL();
return $form;
}
示例6: _createAuthorizationForm
/**
* @param $token OAuthToken
* @param $app OAuthConsumer
* @return Form
*/
public function _createAuthorizationForm($token, $app)
{
$form = new Form();
$form->action = "/app/authorize";
$form->submitText = "Approve App";
$form->add(HiddenField::name('oauth_token')->value($this->args('oauth_token')));
$form->add(HiddenField::name('verifier')->value($token->get('verifier')));
$form->add(TextField::name('name')->label('Name')->help("A nickname for this instance of " . $app->getName() . " such as the name of the computer it's running on or the machine it's intended to control.")->required(true)->value($app->getName()));
return $form;
}