_ Throw ($ msg, $ code) throws an exception. _ redirect ($ url) HTTP301 redirects to the specified URL. This function can be stored anywhere except in the try code block. _ url ($ url, mixed $ paramarray () All applications that use the iPhone framework should use '_ url ()' or '_ action () 'function to generate a link (UR
_ Throw ($ msg, $ code) throws an exception. _ redirect ($ url) Jump to the specified URL in HTTP 301. This function can be stored anywhere except in the try code block. _ url ($ url, mixed $ param = array () All applications using the iPhone framework should use '_ url ()' or '_ action () 'function to generate a link (UR
_throw($msg, $code)
Throw an exception.
_redirect($url)
Jump to the specified URL in HTTP 301. This function can be stored anywhere except in the try code block.
_url($url, mixed $param=array())
All applications that use the iPhone framework should use the '_ url ()' or '_ action ()' function to generate a link (URL) instead of concatenating strings manually.
If '$ url' is a relative path ending with'/view | list', _ special _ url is generated. For example:
_ Url ('/book/view', array ('id' => 1) returns http: // localhost/book/1_url ('/book/list ', array ('page' => 3) returns http: // localhost/book? Page = 3
If '$ param' is a Model instance, its id will be taken out as the URL parameter.
If '$ param' is an array, the array is used as the URL parameter.
_action($act, mixed $m=null, $module='')
If '$ url' ends with'/view | list', _ special _ url is generated. If '$ module' is not specified, the module of the current controller is used.
In addition, iphp also has some built-in common functions for easy URL generation:
* _ New_url ()
* _ Save_url ()
* _ List_url ()
* _ View_url ($ model)
* _ Edit_url ($ model)
_render($view_name)
By default, the iPhone looks for a view with the same name as the action (function name) in the current controller for rendering. for example, if the current action function is 'Find () ', its name is 'Find. tpl. the php view file will be rendered.
However, you can use the '_ render ()' function to modify the View File Name.
Related posts:
- Open-source PHP Lightweight Framework iphp
- The most powerful PHP MySQL operation in history
- Why is iComet better than nginx-push-stream-module?
- Solve Ajax Chinese garbled characters in Prado
- C # Ring Buffer
Original article address: common functions of the iPhone framework. Thank you for sharing them with me.