mtils / formobject Goto Github PK
View Code? Open in Web Editor NEWPainless forms for PHP
License: MIT License
Painless forms for PHP
License: MIT License
This makes if(!$form->wasSubmitted()){ $form->fillByArray()) redundant
Also implement Form::$ignoreFillIfFormSubmitted to switch that behaviour
In order to not manually split prefixes (like address__street) and retrieve fields by pefix this would make the using code much more simple to use
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
Support setReadOnly() or setDisabled() Methods which will trigger all internal work to make a field really disabled
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.
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:
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
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.
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.
The current implementation depends on valid keys. The iterate methods have to be forwarded to an array iterator
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.