本文整理汇总了PHP中Nette\Application\UI\Form::addTextarea方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addTextarea方法的具体用法?PHP Form::addTextarea怎么用?PHP Form::addTextarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Form
的用法示例。
在下文中一共展示了Form::addTextarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createComponentUpload
public function createComponentUpload()
{
$form = new Form();
$form->addUpload('foto', 'Fotografie (max. 2 MB):')->addRule(Form::MAX_FILE_SIZE, 'Maximální velikost souboru je 2 MB.', 2 * 1024 * 1024);
$form->addTextarea("alt", "Popis");
$form->addTextarea("title", "Titulek");
$form->addSubmit('submit', 'Nahrát');
$form->onSuccess[] = callback($this, 'handleSavePhoto');
return $form;
}
示例2: createComponentFormExcelParser
protected function createComponentFormExcelParser()
{
$form = new Form();
$form->addTextarea('clipboard', 'Clipboard:');
$form->addTextarea('template', 'Template:');
$form->addSubmit('generate', 'Generate');
$form->onSuccess[] = callback($this, 'excelParserFormSubmitted');
$form->setDefaults(array('template' => '{{index}}: {{0}}'));
return $form;
}
示例3: createComponentNotesForm
protected function createComponentNotesForm()
{
$form = new Form();
$notesLabel = $this->translator->translate('messages.user.notes');
$form->addTextarea('notes', $notesLabel, $this->enrollment->notes)->setValue($this->enrollment->notes);
$hiddenNotesLabel = $this->translator->translate('messages.user.hiddenNotes');
$form->addTextarea('hiddenNotes', $hiddenNotesLabel)->setValue($this->enrollment->hiddenNotes);
$submitLabel = $this->translator->translate('messages.user.saveNotes');
$form->addSubmit('submit', $submitLabel);
$form->onSuccess[] = array($this, 'notesFormSucceeded');
return $form;
}
示例4: createComponentContactForm
/**
* Contact form
*/
protected function createComponentContactForm()
{
// vytvoříme element
$products = array('Zakladni' => 'Základní', 'Pokrocile' => 'Pokročilé', 'NaMiru' => 'Na Míru', 'Ostatni' => 'Ostatní');
$form = new Form();
$form->addText('name', 'Jméno ')->addRule(Form::FILLED, 'Zadejte jméno');
$form->addSelect('product', 'Produkt:', $products)->setRequired()->setDefaultValue('Zakladni');
$form->addText('phone', 'Telefon ');
$form->addText('email', 'Email')->addRule(Form::FILLED, 'Zadejte email')->addRule(Form::EMAIL, 'Email nemá správný formát');
$form->addTextarea('message', 'Zpráva', 999, 5)->addRule(Form::FILLED, 'Zadejte zprávu');
$form->addSubmit('send', 'Odeslat');
// setup form rendering
$renderer = $form->getRenderer();
$renderer->wrappers['controls']['container'] = NULL;
$renderer->wrappers['pair']['container'] = 'div class=form-group';
$renderer->wrappers['pair']['.error'] = 'has-error';
$renderer->wrappers['control']['container'] = 'div class=col-sm-12';
$renderer->wrappers['label']['container'] = 'div class="col-sm-12 text-center"';
$renderer->wrappers['control']['description'] = 'span class=help-block';
$renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
// make form and controls compatible with Twitter Bootstrap
$form->getElementPrototype()->class('form-horizontal');
foreach ($form->getControls() as $control) {
if ($control instanceof Controls\Button) {
$control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-green btn-block btn-lg' : 'btn btn-default');
$usedPrimary = TRUE;
} elseif ($control instanceof Controls\TextBase || $control instanceof Controls\SelectBox || $control instanceof Controls\MultiSelectBox) {
$control->getControlPrototype()->addClass('form-control');
} elseif ($control instanceof Controls\Checkbox || $control instanceof Controls\CheckboxList || $control instanceof Controls\RadioList) {
$control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
}
}
$form->onSuccess[] = $this->processContactForm;
return $form;
}
示例5: createComponentMessageForm
protected function createComponentMessageForm()
{
$form = new Form();
$form->addTextarea('message');
$form->addSubmit('submit');
$form->onSuccess[] = array($this, 'messageFormSucceeded');
return $form;
}
示例6: createComponentExampleForm
/**
* Example form factory
* @return Form
*/
protected function createComponentExampleForm()
{
$form = new Form();
$form->addTextarea("text", "Text", 110, 20)->getControlPrototype()->class("texyla");
$form->addSubmit("s", "Submit");
$form->onSuccess[] = callback($this, 'exampleFormSubmitted');
return $form;
}
示例7: create
/**
* @return Form
*/
public function create()
{
$form = new Form();
$form->addText('name', 'Jméno:')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'Nevyplněno')->setRequired('Zadejte prosím jméno.');
$form->addTextarea('comment', 'Komentář:')->setAttribute('class', 'form-control')->setAttribute('rows', 'auto')->setAttribute('placeholder', 'Nevyplněno')->setRequired('Komentář je prázdný.');
$form->addSubmit('submit', 'Uložit')->setAttribute('class', 'btn btn-primary');
$form->onSuccess[] = array($this, 'formSucceeded');
return $form;
}
示例8: createComponentContactForm
/**
* Contact form
*/
protected function createComponentContactForm()
{
$form = new Form();
$form->addText('name', 'Jméno:')->addRule(Form::FILLED, 'Zadejte jméno');
$form->addText('email', 'Email:')->addRule(Form::FILLED, 'Zadejte email')->addRule(Form::EMAIL, 'Email nemá správný formát');
$form->addTextarea('message', 'Zpráva:')->addRule(Form::FILLED, 'Zadejte zprávu');
$form->addSubmit('send', 'Odeslat');
$form->onSuccess[] = $this->processContactForm;
return $form;
}
示例9: createComponentTexyForm
public function createComponentTexyForm()
{
$form = new Form();
$input = $form->addTextarea('content', "Content:")->getControlPrototype();
$input->data('codemirror', 'init');
$input->data('mode', 'texy');
$input->data('image', $this->link('saveImage!'));
$form->addSubmit('actionSend', 'Save');
$form->onSuccess[] = array($this, 'texyFormSubmitted');
return $form;
}
示例10: createComponentEmailForm
function createComponentEmailForm()
{
$form = new Form();
$form->addText('name')->setAttribute('id', 'name')->setAttribute('class', 'text')->addRule(Form::FILLED, 'Invalid Name!');
$form->addText('email')->setAttribute('id', 'email')->setAttribute('class', 'text')->addRule(Form::FILLED, 'Invalid E-Mail!')->addRule(Form::EMAIL, 'Invalid E-Mail!');
$form->addText('subject')->setAttribute('id', 'subject')->setAttribute('class', 'text')->addRule(Form::FILLED, 'Invalid Subject!');
$form->addTextarea('message')->setAttribute('id', 'message')->setAttribute('class', 'text')->setAttribute('rows', '10')->setAttribute('cols', '50')->addRule(Form::FILLED, 'Invalid Text!');
$form->addSubmit('send')->setAttribute('vale', 'Send')->setAttribute('class', 'sendit');
$form->onSuccess[] = array($this, 'emailFormSucceeded');
return $form;
}
示例11: createComponentContactForm
protected function createComponentContactForm()
{
$form = new Form();
$rendered = new Bs3FormRenderer();
$rendered->wrappers['control']['container'] = 'div class=col-sm-10';
$rendered->wrappers['label']['container'] = 'div class="col-sm-2 control-label"';
$form->addProtection('Vypršel časový limit, odešlete formulář znovu');
$form->setRenderer($rendered);
$form->addText('name', 'Vaše jméno')->addRule(Form::FILLED, 'Vyplňte vaše jméno');
$form->addText('email', 'Váš e-mail')->setEmptyValue('@')->addRule(Form::FILLED, 'Vyplňte váš e-mail')->addRule(Form::EMAIL, 'E-mail má nesprávný tvar');
$form->addTextarea('text', 'Zpráva')->addRule(Form::FILLED, 'Vyplňte zprávu')->setAttribute('rows', 12);
$form->addReCaptcha('captcha')->addRule(ReCaptchaControl::VALID, 'Zatrhněte, že nejste robot :)');
$form->addSubmit('okSubmit', 'Odeslat');
$form->onSuccess[] = [$this, 'contactFormSubmitted'];
return $form;
}
示例12: createComponentDuplicateForm
protected function createComponentDuplicateForm()
{
$form = new Nette\Application\UI\Form();
$form->addText('rezervace_id');
$form->addText('zakaznik');
$form->addTextarea('poznamka');
$form->addText('datum_od');
$form->addText('datum_do');
$form->addText('telefon');
$form->addText('email');
$model = $this->context->rezervace;
$apartmany = $model->getApartments();
$apartman[] = "";
foreach ($apartmany as $zal) {
$apartman[$zal->apartman_id] = $zal->nazev;
}
$form->addSelect('apartman_id', 'asdf', $apartman);
$form->addSubmit('send', 'Přidat');
$form->onSuccess[] = $this->duplicateFormSucceeded;
return $form;
}
示例13: createComponentMenu
public function createComponentMenu()
{
$form = new UI\Form();
$this->database->table('master_menus')->order('name DESC');
$menuList = array(0 => "No Parent");
$menuList += $wings = $this->database->table('master_menus')->fetchPairs('id', 'name');
$form->addHidden('created')->setValue(date('Y-m-d H:i:s'));
$form->addHidden('modified')->setValue(date('Y-m-d H:i:s'));
$form->addHidden('created_by')->setValue(1);
$form->addHidden('modified_by')->setValue(1);
$form->addText('name', 'Menu Name :')->setRequired("Please enter menu name");
$form->addText('menu_url', 'Menu URL :')->setRequired("Please enter menu name");
$form->addTextarea('description', 'Menu Description :')->setRequired("Please enter menu description");
$form->addSelect('parent_id', 'Parent Menu Name :', $menuList);
$form->addSubmit('save', 'Save');
$form->onSuccess[] = array($this, 'menuSucceeded');
return $form;
}
示例14: createComponentEditEventForm
/**
* Form for editing the invitations to events
*
* @Action("edit")
* @Privilege("edit")
*/
protected function createComponentEditEventForm()
{
$form = new Form();
$form->addProtection('Vypršel časový limit, odešlete formulář znovu');
$form->addHidden('id');
$form->addText('name', 'Název akce:')->setRequired('Vyplňte název akce');
$form->addTextarea('text', 'Úvodní text lístečku:')->setRequired('Vyplňte text lístečku')->setAttribute('rows', 5);
$form->addDynamic('event_meeting', function (Container $container) {
$container->addText('comment', 'Typ srazu:');
$container->addDateTimePicker('starttime', 'Datum a čas srazu:')->setRequired('Vyplňte čas srazu');
$container->addText('startplace', 'Místo srazu:')->setRequired('Vyplňte místo srazu');
$container->addDateTimePicker('endtime', 'Datum a čas návratu:')->setRequired('Vyplňte čas návratu');
$container->addText('endplace', 'Místo návratu:')->setRequired('Vyplňte místo návratu');
$container->addSubmit('remove', 'X')->setValidationScope(FALSE)->addRemoveOnClick();
//intentional, delete after whole form submit
}, 1)->addSubmit('add', 'Přidat sraz')->setValidationScope(FALSE)->addCreateOnClick(TRUE);
$form->addTextarea('equipment', 'S sebou:')->setRequired('Vyplňte co si s sebou vzít na akci')->setAttribute('rows', 5);
$form->addTextarea('morse', 'Morseovka:')->setAttribute('rows', 5);
//contact person
$contacts = $this->registrations->findBy(['member_nickname IS NOT NULL'])->fetchPairs('member_nickname', 'member_nickname');
$form->addSelect('contactperson', 'Kontaktní osoba:', $contacts)->setRequired('Vyberte kontaktní osobu')->setPrompt('Kontaktní osoba');
if ($this->user->isAllowed('Admin:Default:Event', 'show')) {
$form->addCheckbox('showevent', 'Zobrazit lísteček')->setDefaultValue(TRUE);
}
$form->addSubmit('send', 'Změnit');
$form->onSuccess[] = $this->editEventFormSucceded;
return $form;
}
示例15: createComponentEditChronicleForm
/**
* Form for inputting information about the event to form chronicle
* Can only be accessed by user with editing privileges and only in "edit" action
*
* @Privilege("edit")
* @Action("edit")
*/
protected function createComponentEditChronicleForm()
{
$form = new Form();
$form->addProtection('Vypršel časový limit, odešlete formulář znovu');
$form->addHidden('id');
$form->addText('name', 'Název akce');
$form->addTextarea('rangers', 'Vedení a roveři');
$form->addTextarea('mloci', 'Mloci:');
$form->addTextarea('tucnaci', 'Tučňáci:');
$form->addTextarea('novacci', 'Nováčci:');
$form->addTextarea('route', 'Trasa:');
$form->addTextarea('content', 'Zápis do kroniky:');
$writers = $this->members->findAll()->fetchPairs('nickname', 'nickname');
$form->addSelect('chroniclewriter', 'Zapsal do kroniky:', $writers)->setRequired('Musíte vybrat, kdo zapsal akci do kroniky')->setPrompt('Vyberte člena');
if ($this->user->isAllowed('Admin:Default:Chronicle', 'show')) {
$form->addCheckbox('showchronicle', 'Zobrazit kroniku:')->setDefaultValue(TRUE);
}
$form->addSubmit('send', 'Upravit');
$form->onSuccess[] = $this->editChronicleFormSucceded;
return $form;
}