thinkphp5.0 study notes (b)

1, the controller loads the page

public  function index () {
     // specifies the view folder, [action] .html, but if not specified, then it can pass parameters 
    return  $ the this -> FETCH ();
     // Render the specified abc page 
    return  the this $ -> FETCH ( 'ABC' );
     // the system built-in methods 
    return View ();
     // use Think \ View; under the premise 
    return  also call_user_func ([ new new View (), 'FETCH' ]); 
}

Note: For the return of data, if needed, can be adjusted in the config.php 'default_return_type' => 'html'; html is the default if desired can be converted into json

 

10, common knowledge

  IS_WIN: determine whether the current system is the window

  THINK_PATH: returns the current working directory thinkphp

  APP_PATH: returns the application's working directory

  dump (): the method is a helper in the browser-friendly variable output

  input ( 'key'): is used to obtain the parameters passed, i.e. the incoming address bar

Guess you like

Origin www.cnblogs.com/rickyctbu/p/11531232.html