GithubHelp home page GithubHelp logo

formobject's People

Contributors

mtils avatar schauer avatar

Watchers

 avatar  avatar  avatar

Forkers

schauer aktiweb

formobject's Issues

Inject Laravel Objects

Inject UrlGenerator in FormObject\Support\Laravel\Http\CurrentActionUrlProvider
Inject Request in FormObject\Support\Laravel\Http\InputRequestProvider
Inject UrlGenerator and Router in FormObject\Support\Laravel\Http\ResourceActionUrlProvider

Add readonly support

Support setReadOnly() or setDisabled() Methods which will trigger all internal work to make a field really disabled

Fix the offset errors in FieldList

Firstly in offsetUnset() the datafields are not updated.
The second thing is that if you use before() the key is removed from the keyOrder array before it is clear that the target $fieldName exists.

Allow throwing exceptions while getting data from form

In order to remove duplicated code in controllers the standard usage in post methods should be instead of this:

if($this->form->wasSubmitted() as $this->form->getValidator()->passes()){
    $user->address->fill($this->form->getData('address'));
    $user->fill($this->form->getData(''));
    $user->save();
}
else{
    Redirect::to('getFoo');
}

it should be written as this:

try{
    $user->address->fill($this->form->getOrFail('address'));
    $user->fill($this->form->getOrFail(''));
    $user->save();
}
catch(ValidationException $e){
    Redirect::to('getFoo')->withInput()->withErrors($e);
}

The steps needed are:

  1. implement ValidatorException (for Laravel implementing MessageProviderInterface)
  2. implement AdapterFactoryInterface::createValidationException($validator)
  3. implement Form::getOrFail which throws the exception

Prevent double validation on laravel redirects

Laravel\ValidatorAdapter should look for Session::get('errors') and return them to fullfill the needs of hasErrors() and getMessages().
If the form wasnt submitted return an empty array

Session store not set on request

Used with laravel 5 there is an issue with the request object stored in InputRequestProvider. The request is missing the session store, causing a runtime exception during form rendering.

Do not auto fill forms in EditManyField

The problem is here that in any template Field::__toString() is called. This calls $this->form->autoFillIfNotDone(). This causes the subform to load the complete request into itself.
Then the editManyField gets wrong data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.