About the routing jump controller in laravel

Source: Internet
Author: User
I now have a link of this type: www. xxx. comapisignup where the api is controller ApiController and signup needs to be changed. it may be signin, create, del, move, etc. how can I write in the route, in order to make the subsequent values correspond to the specified controller... I now have links of this type:
Http://www.xxx.com/api/signup

The api is the controller ApiController.

Signup needs to be transformed. it may be signin, create, del, move, etc.

How can I write it in the route so that the subsequent values correspond to the methods in the specified controller?

That is to say, access http://www.xxx.com/api/signupto apply to the signup.pdf under the apicontroller, and check signin,create,del,move

Reply content:

I now have links of this type:
Http://www.xxx.com/api/signup

The api is the controller ApiController.

Signup needs to be transformed. it may be signin, create, del, move, etc.

How can I write it in the route so that the subsequent values correspond to the methods in the specified controller?

That is to say, access http://www.xxx.com/api/signupto apply to the signup.pdf under the apicontroller, and check signin,create,del,move

Route: controller ('api ', 'apicontroller ',[

'signup' => 'api.signup','signin' => 'api.signin','create' => 'api.create','del' => 'api.del','move' => 'api.move',

]);

Class ApiController extends Controller
{

public function getSignup(){    return 'index';}public function getSignin(){    return 'create';}..........

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.