Example #1
0
 /**
  * Use values stored in Form to populate the current field
  */
 private function repopulate($fallback = null)
 {
     // Get values from POST, populated, and manually set value
     $post = $this->app['form']->getPost($this->name);
     $populator = $this->form ? $this->form->getPopulator() : $this->app['form.populator'];
     $populate = $populator->get($this->bind ?: $this->name);
     // Assign a priority to each
     if (!is_null($post)) {
         return $post;
     }
     if (!is_null($populate)) {
         return $populate;
     }
     return $fallback ?: $this->value;
 }