Skip to content
This repository was archived by the owner on Feb 26, 2018. It is now read-only.

Form namespaces #109

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Form namespaces #109

wants to merge 15 commits into from

Conversation

jesseleite
Copy link
Contributor

@jesseleite jesseleite commented Dec 6, 2016

Adds form namespaces. Usage example:

Form::name('profile')->open()
    Form::bind($bindProfileInputs)
    // Form inputs
Form::close()

Form::name('survey')->open()
    Form::bind($bindSurveyInputs)
    // Form inputs
Form::close()

If both forms have an explicit namespace, when you submit one form, the other form's bound input will be left alone (rather than checking old input on both forms).

@axyr
Copy link

axyr commented Dec 6, 2016

Why not Form::open()->name('myformname') ?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 94.241% when pulling 52c25ba on JesseLeite:form-namespaces into da9e21c on adamwathan:master.

@jesseleite
Copy link
Contributor Author

@axyr I had Form::open()->namespace() in my first two commits, but we needed to store the namespace on the builder instance. Adam suggested it be implemented at the builder level, similar to Form::bind() for that reason.

@coveralls
Copy link

coveralls commented Dec 6, 2016

Coverage Status

Coverage decreased (-0.06%) to 94.7% when pulling 1da7028 on JesseLeite:form-namespaces into da9e21c on adamwathan:master.

@jesseleite
Copy link
Contributor Author

@adamwathan @axyr Updated implementation to accept name() before open() 👍 Example...

Form::name('profile')->open()
    Form::bind($bindProfileInputs)
    // Form inputs
Form::close()

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 94.344% when pulling b349416 on JesseLeite:form-namespaces into da9e21c on adamwathan:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 94.286% when pulling 6daf1ce on JesseLeite:form-namespaces into da9e21c on adamwathan:master.

@coveralls
Copy link

coveralls commented Dec 7, 2016

Coverage Status

Coverage increased (+0.2%) to 95.0% when pulling 3b30df4 on JesseLeite:form-namespaces into da9e21c on adamwathan:master.

@coveralls
Copy link

coveralls commented Mar 4, 2017

Coverage Status

Coverage increased (+0.2%) to 95.089% when pulling 33513e1 on JesseLeite:form-namespaces into cc5c2b6 on adamwathan:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants