php - Basic post route does not work -


I am new to Larval 4, and I just create a new project, and do some practice after the official tutorial . For the routing part, an example of the original post route is

the original post root

  root :: post ('foo / bar', function () {returns' hello world';});  

But when I add a post path to my project

  root :: post ('/'), function () {return 'welcome'; });  

This "405 - method is not permitted" error shows why this happens? Post method can not be used to show something?

To answer your immediate question:

Send data to the post server , So that the server can perform the activity.

You should use it:

  Root :: find ('/', work () {return 'welcome';});  

To provide a complete answer

I understand your motive to return, provided you are new to Larwell. But, please help me:

Laravel is an MVC framework (model, visual, controller).

App / Root.FP

Root :: Controller Please state that any request directed at that specific URI will It will handle it.

  Root :: Controller ('SOME_URI', 'Home Controller');  

App / Controller / Home Controller. FP

Look under the heading "Resources handled by resource processing controller". The table column "Action" shows "Default Function Name", which recognizes Laravel. The following are the results of the request received in Laurel using the index function as given below:

  class home controller extends the Base Controller {Public Function Index () {return View :: Make ('home.index'); }}  

app / view / index.php

  Put whatever HTML you want  

If you type in the full url you will get the content in that view / index.php. I can not be politically correct. But controls the output to the controls, the controller Handles logic, model manipulation (db, etc.).


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -