public function setUp()
 {
     parent::setUp();
     $this->view = $this->app['view'];
     $this->request = $this->app['request'];
     $this->request->setSession($this->app['session.store']);
     $this->validatorFactory = $this->app['validator'];
     $this->model = Mockery::mock('Illuminate\\Database\\Eloquent\\Model');
     $this->config = (include __DIR__ . '/../src/config/config.php');
     $this->formHelper = new FormHelper($this->view, $this->request, $this->config);
     $this->formBuilder = new FormBuilder($this->app, $this->formHelper);
     $this->plainForm = $this->formBuilder->plain();
 }
 public function setUp()
 {
     parent::setUp();
     $this->view = $this->app['view'];
     $this->request = $this->app['request'];
     $this->request->setSession($this->app['session.store']);
     $this->validatorFactory = $this->app['validator'];
     $this->model = new TestModel();
     $this->config = (include __DIR__ . '/../src/config/config.php');
     $this->formHelper = new FormHelper($this->view, $this->config);
     $this->formBuilder = new FormBuilder($this->app, $this->formHelper);
     $this->plainForm = $this->formBuilder->plain();
 }
Example #3
0
 /**
  * Gets existing instance or create a new search input form.
  *
  * @param string $action Form action URL
  * @return Form
  */
 public static function getSearchForm($action = '')
 {
     $class = get_called_class();
     if (empty(self::$searchForms[$class])) {
         self::$searchForms[$class] = self::$formBuilder->plain(['class' => 'form-inline', 'method' => 'get', 'url' => $action])->add('query', 'text', ['label' => false, 'attr' => ['placeholder' => self::$translator->trans('lavanda::common.search_placeholder')]])->add('search', 'submit', ['label' => self::$translator->trans('lavanda::common.search_button')]);
     }
     return self::$searchForms[$class];
 }
Example #4
0
 /**
  * Get instance of the empty form which can be modified
  *
  * @param array $options
  * @param array $data
  * @return \Form 
  * @static 
  */
 public static function plain($options = array(), $data = array())
 {
     return \Kris\LaravelFormBuilder\FormBuilder::plain($options, $data);
 }