本文整理汇总了PHP中Venne\Forms\Form::addFileEntityInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addFileEntityInput方法的具体用法?PHP Form::addFileEntityInput怎么用?PHP Form::addFileEntityInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::addFileEntityInput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup('Person');
$form->addSelect('type', 'Person', PersonEntity::getTypes());
$form->addText('name', 'Name');
$form->addFileEntityInput('logo', 'Logo');
$form->addManyToMany('users', 'Users');
$form->addTextArea('description', 'Description');
$form->addGroup('Address');
$form->addText('street', 'Street');
$form->addText('number', 'Number');
$form->addText('city', 'City');
$form->addText('zip', 'ZIP');
$form->addGroup('Contacts');
$form->addText('email', 'Email')->addCondition($form::FILLED)->addRule($form::EMAIL);
$form->addText('phone', 'Phone');
$form->addText('fax', 'Fax');
$form->addText('website', 'Website')->addCondition($form::FILLED)->addRule($form::URL);
$form->addGroup('Billing information');
$form->addText('identificationNumber', 'IN');
$form->addText('taxIdentificationNumber', 'TIN');
$form->addText('registration', 'Registration');
$form->addCheckbox('taxpayer', 'Taxpayer');
$form->addFileEntityInput('signature', 'Signature');
$form->addSaveButton('Save');
}
示例2: 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');
}
示例3: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addGroup();
$form->addFileEntityInput('image', 'Image');
$form->addText('alt', 'Alt');
if (!$form->data->hideWidth || !$form->data->hideHeight || !$form->data->hideFormat) {
$form->addGroup('Size');
if (!$form->data->hideWidth) {
$form->addText('width', 'Width')->addCondition($form::FILLED)->addRule($form::INTEGER);
}
if (!$form->data->hideHeight) {
$form->addText('height', 'Height')->addCondition($form::FILLED)->addRule($form::INTEGER);
}
if (!$form->data->hideFormat) {
$form->addSelect('format', 'Format', array(0 => 'Fit', 1 => 'Shrink only', 2 => 'Stretch', 4 => 'Fill', 8 => 'Exact'));
}
}
if (!$form->data->hideType) {
$form->addSelect('type', 'Type', array('png' => 'PNG', 'jpeg' => 'JPEG', 'gif' => 'GIF'))->setPrompt('-- default --');
}
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例4: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addFileEntityInput('file', 'File');
$form->addSaveButton('Save');
}
示例5: configure
public function configure(Form $form)
{
$form->addFileEntityInput('_photos', 'Upload photos')->setMulti(TRUE);
$form->addSaveButton('Upload');
}