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