Home  >  Article  >  Backend Development  >  Laravel request parameter encapsulation?

Laravel request parameter encapsulation?

WBOY
WBOYOriginal
2016-09-02 08:57:041221browse

Some mvc frameworks under java and .net platforms have the following features:

Form data:

<code>user.name:'admin',
user.pwd:'123'</code>

mvc framework interface method

<code class="java">public String add(User user){
    ...
}</code>

The mvc framework will encapsulate the parameters in the request into the user parameter of the add method. Are there any related features in laravel? How to achieve?

Reply content:

Some mvc frameworks under java and .net platforms have the following features:

Form data:

<code>user.name:'admin',
user.pwd:'123'</code>

mvc framework interface method

<code class="java">public String add(User user){
    ...
}</code>

The mvc framework will encapsulate the parameters in the request into the user parameter of the add method. Are there any related features in laravel? How to achieve?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn