/** * Set up form * * @return void * @author Dan Cox */ public function configure() { $this->route = 'form.test'; $this->method = 'post'; $model = DI::getContainer()->get('entity')->load('Wasp\\Test\\Entity\\Entities\\Contact'); $model->name = 'Dan'; $model->message = 'This is a default message'; $model->save(); $this->model = $model; }
/** * Converts the collection class into a json string * * @return String * @author Dan Cox */ public function json() { $serializer = DI::getContainer()->get('serializer'); return $serializer->serialize($this->collectable, 'json'); }
/** * Configures the form based on its properties * * @author Dan Cox */ public function __construct() { $this->container = DI::getContainer(); $this->name = base64_encode(get_called_class()); $this->errors = new Collection(); $this->configure(); $this->setup(); }