本文整理汇总了PHP中Venne\Forms\Form::addText方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addText方法的具体用法?PHP Form::addText怎么用?PHP Form::addText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::addText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('appId', 'App ID');
$form->addText('secret', 'Secret');
$form->addSelect('cookie', 'Use cookie', array(TRUE => 'yes', FALSE => 'no'));
$form->addSaveButton('Save');
}
示例2: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Basic settings');
$form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql');
$form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset');
$form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection');
$form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite');
$form->addGroup('Connection settings');
$form->addText('user', 'Username');
$form->addPassword('password', 'Password');
$form->addGroup()->setOption('id', 'group-connection');
$form->addText('host', 'Host');
$form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default';
$form->addText('dbname', 'Database');
$form->addGroup()->setOption('id', 'group-sqlite');
$form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false);
$form->addCheckbox('memory', 'Db in memory');
$form->addGroup()->setOption('id', 'group-charset');
$form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false);
$backups = $this->getBackups();
if (count($backups)) {
$form->addGroup('Restore from backup');
$form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------');
}
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例3: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('startDepth', 'Start depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
$form->addText('maxDepth', 'Max depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
$form->addManyToOne('root', 'Root page');
$form->addSaveButton('Save');
}
示例4: configure
public function configure(Form $form)
{
$_this = $this;
$route = $form->addOne('route');
$group = $form->addGroup();
$route->setCurrentGroup($group);
$form->addText('name', 'Name');
$form->addText('price', 'Price')->setDefaultValue(0)->addCondition($form::FILLED)->addRule($form::FLOAT);
$form->addText('rrp', 'RRP')->addCondition($form::FILLED)->addRule($form::FLOAT);
$route->addTextArea('notation', 'Description');
$route->addFileEntityInput('photo', 'Image');
$form->addText('inStock', 'In stock')->addCondition($form::FILLED)->addRule($form::FLOAT);
$form->addGroup('');
$form->addManyToOne('category', 'Main category');
$form->addManyToMany('categories', 'Next categories');
$form->addGroup();
$form->addManyToMany('labels', 'Labels');
$tags = $form->addContainer('tags');
$tags->setCurrentGroup($group = $form->addGroup());
$form->addGroup('Types');
$form->addTags('typesAsArray', 'Types')->setSuggestCallback(function () use($_this, $form) {
$ret = array();
foreach ($_this->getTagsFromCategories($form) as $tag) {
$ret[$tag] = $tag;
}
return $ret;
})->setDelimiter('[;]+')->setJoiner(';');
$form->addGroup();
$form->addSaveButton('Save');
}
示例5: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$entity = $form->data;
$form->addGroup('Supplier');
$form->addManyToOne('supplier', 'person')->addRule($form::FILLED);
$form->addGroup('Customer');
$form->addManyToOne('customer', 'person')->addRule($form::FILLED);
$form->addGroup('Billing information');
$form->addText('identification', 'Identification');
$form->addText('amount', 'Amount')->addRule($form::FILLED)->addRule($form::FLOAT);
$form->addManyToOne('payment', 'Payment');
$form->addSelect('type', 'Type')->setItems(InvoiceEntity::getTypes());
$form->addSelect('state', 'State')->setItems(InvoiceEntity::getStates());
$form->addText('constantSymbol', 'Constant sb.');
$form->addText('variableSymbol', 'Variable sb.');
$form->addText('specificSymbol', 'Specific sb.');
$group = $form->addGroup('Items');
$recipients = $form->addMany('items', function (Container $container) use($group, $form) {
$container->setCurrentGroup($group);
$container->addText('name', 'Name')->addRule($form::FILLED);
$container->addText('unitValue', 'Unit value')->addRule($form::FILLED)->addRule($form::FLOAT);
$container->addText('units', 'Units')->addRule($form::FILLED)->addRule($form::INTEGER);
$container->addText('qUnit', 'Quantity unit')->addRule($form::FILLED);
$container->addText('tax', 'Tax')->addRule($form::FLOAT);
$container->addCheckbox('unitValueIsTaxed', 'Value is taxed');
$container->addSubmit('remove', 'Remove')->addRemoveOnClick();
}, function () use($entity) {
return new ItemEntity($entity);
});
$recipients->setCurrentGroup($group);
$recipients->addSubmit('add', 'Add item')->addCreateOnClick();
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例6: configure
public function configure(Form $form)
{
$form->addText('text', 'Text');
$form->addText('priceFrom', 'Price from');
$form->addText('priceTo', 'Price to');
$form->addCheckboxList('labels', 'Labels')->setItems($this->getLabels(), FALSE);
$form->addSaveButton('Apply');
}
示例7: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Administration settings');
$form->addText('routePrefix', 'Route prefix');
$form->addText('defaultPresenter', 'Default presenter');
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例8: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup('Settings');
$form->addText('itemsPerPage', 'Items per page');
$form->addText('messageMaxLength', 'Message max length')->addCondition($form::FILLED)->addRule($form::NUMERIC);
$form->addGroup();
$form->addSaveButton('Save');
}
示例9: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup('Options');
$form->addManyToOne('rootPage', 'Root page')->setPrompt(NULL);
$form->addText('maxDepth', 'Maximal depth')->addRule($form::INTEGER);
$form->addText('maxWidth', 'Maximal width')->addRule($form::INTEGER);
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例10: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('name', 'Jméno')->addRule($form::FILLED, 'Vyplňte prosím jméno');
$form->addText('latitude', 'Zeměpisná šířka (N)')->addCondition($form::FILLED)->addRule($form::FLOAT, 'Zadaná souřadnice je ve špatném tvaru');
$longitude = $form->addText('longitude', 'Zeměpisná výška (E)');
$longitude->addCondition($form::FILLED)->addRule($form::FLOAT, 'Zadaná souřadnice je ve špatném tvaru');
$form->addSubmit('_gps', 'Detekovat GPS')->onClick[] = $this->gpsClick;
$form->addSaveButton('Save');
}
示例11: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('name', 'Name')->addRule($form::FILLED);
$form->addText('domain', 'Domain')->addRule($form::FILLED);
/** @var ManyToOne $page */
$page = $form->addOneToOne('page', 'Page');
$page->setQuery($this->pageRepository->createQueryBuilder('a')->orderBy('a.positionString', 'ASC'));
$form->addSaveButton('Save');
}
示例12: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('name', 'Name');
$form->addManyToOne('account', 'Account')->addRule($form::FILLED);
$form->addText('identificationFormat', 'ID format')->addRule($form::FILLED);
$form->addSelect('identificationInterval', 'ID interval', AccountEntity::getIntervals())->addRule($form::FILLED);
$form->addText('due', 'Invoice due')->addRule($form::FILLED)->addRule($form::INTEGER);
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例13: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup();
$form->addText('itemsPerPage', 'Items per page');
$form->addManyToMany('pages', 'Pages');
$form->addManyToMany('categories', 'Categories');
$form->addGroup('Dimensions');
$form->addText('width', 'Width')->addCondition($form::FILLED)->addRule($form::INTEGER);
$form->addText('height', 'Height')->addCondition($form::FILLED)->addRule($form::INTEGER);
$form->addGroup();
$form->addSaveButton('Save');
}
示例14: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup('Settings');
$form->addText('itemsPerPage', 'Items per page');
$form->addGroup('Notation');
$form->addCheckbox('notationInHtml', 'In HTML format');
$form->addCheckbox('autoNotation', 'Auto generate')->addCondition($form::EQUAL, true)->toggle('notationLength');
$form->addGroup()->setOption('id', 'notationLength');
$form->addText('notationLength', 'Length')->addRule($form::INTEGER);
$form->addGroup();
$form->addSaveButton('Save');
}
示例15: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup();
$form->addText('name', 'Name');
$form->addText('localUrl', 'URL');
$form->addText('title', 'Title');
$form->addText('keywords', 'Keywords');
$form->addText('description', 'Description');
$form->addManyToOne('author', 'Author');
$form->addSelect('robots', 'Robots')->setItems(RouteEntity::getRobotsValues(), FALSE);
$form->addSelect('changefreq', 'Change frequency')->setItems(RouteEntity::getChangefreqValues(), FALSE)->setPrompt('-------');
$form->addSelect('priority', 'Priority')->setItems(RouteEntity::getPriorityValues(), FALSE)->setPrompt('-------');
// layout
$form->setCurrentGroup($form->addGroup());
$form->addCheckbox('copyLayoutFromParent', 'Layout from parent');
$form['copyLayoutFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-layout_' . $form->data->id);
$form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout_' . $form->data->id));
$form->addManyToOne('layout', 'Layout');
$form->setCurrentGroup($form->addGroup());
$form->addCheckbox('copyLayoutToChildren', 'Share layout with children');
$form['copyLayoutToChildren']->addCondition($form::EQUAL, FALSE)->toggle('group-layout2_' . $form->data->id);
$form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout2_' . $form->data->id));
$form->addManyToOne('childrenLayout', 'Share new layout');
// cache
$form->setCurrentGroup($form->addGroup());
$form->addCheckbox('copyCacheModeFromParent', 'Cache mode from parent');
$form['copyCacheModeFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-cache_' . $form->data->id);
$form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-cache_' . $form->data->id));
$form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
$form->setCurrentGroup($form->addGroup());
$form->addFileEntityInput('photo', 'Photo');
$form->addTextArea('notation', 'Notation');
$form->addTextArea('text', 'Text');
$form->addGroup('Dates');
$form->addDateTime('created', 'Created')->setDisabled(TRUE);
$form->addDateTime('updated', 'Updated')->setDisabled(TRUE);
$form->addDateTime('released', 'Released')->addRule($form::FILLED);
$form->addDateTime('expired', 'Expired');
$form->addGroup('Tags');
$form->addContentTags('tags');
$aliases = $form->addMany('aliases', function (\Venne\Forms\Container $container) use($form) {
$container->setCurrentGroup($form->addGroup('URL alias'));
$container->addText('aliasUrl', 'Url')->setRequired();
$container->addText('aliasLang', 'Language alias');
$container->addText('aliasDomain', 'Domain url');
$container->addSubmit('remove', 'Remove alias')->addRemoveOnClick();
});
$aliases->addSubmit('add', 'Add alias')->addCreateOnClick();
$form->setCurrentGroup();
$form->addSaveButton('Save');
}