示例#1
0
 public function testGenerateInput()
 {
     FormGenerator::start('text');
     FormGenerator::addName('AnyInputName');
     $itemsArray = ['AnyElement' => 'AnyValue'];
     FormGenerator::addItem($itemsArray);
     FormGenerator::required();
     $this->assertEquals('<input type="text" name="AnyInputName" required AnyElement="AnyValue">', FormGenerator::render());
 }
示例#2
0
文件: Search.php 项目: ignaszak/cms
 /**
  *
  * @param array $customItem
  * @return string
  */
 public function inputSearch(array $customItem = null) : string
 {
     FormGenerator::start('text');
     FormGenerator::addName('search');
     FormGenerator::addItem(['class' => 'form-control']);
     FormGenerator::addItem($customItem);
     FormGenerator::required();
     return FormGenerator::render();
 }
示例#3
0
文件: User.php 项目: ignaszak/cms
 /**
  *
  * @param string $name
  */
 private function addAccountValue(string $name)
 {
     if ($this->formAction === 'accountData') {
         $entityGetter = $this->getEntityGetter($name);
         FormGenerator::addItem(['value' => $this->user->getUserSession()->{$entityGetter}()]);
     }
 }