Recommend this page to a friend! |
Classes of Fernando Val | Springy | documentation/en/library/URI.md | Download |
|
DownloadURIAboutURI is a static class used by the framework to translate and construct URL and URI and query strings. PropertiesThe class has no properties you can access directly. |Property|Type|Description| |---|---|---| |$uri_string|private static|The current URI| |$segments|private static|An array of the URI segments| |$ignored_segments|private static|An array of the URI segments ignored by the framework to translate de controller| |$get_params|private static|An array of the variables received in the query string passed by HTTP GET method| |$segment_page|private static|The index of the segment which determines the current page| |$class_controller|private static|The name of the controller class| Methods|Name|Type|Description| |---|---|---| |_fetch_uri_string()|private static|Get the URI string.| |_set_class_controller()|private static|Define the name of the controller class.| |parseURI()|public static|Translate the URI in segments and query string variables. This method is used by the framework starter to determine the controller which is be called.| |validateURI()|public static|Validate the segments quantity for the current controller.| |getControllerClass()|public static|Return the name of the controller class.| |getURIString()|public static|Return the URI string.| |currentPage()|public static|Return the content of the segment which represent the current page.| |relativePathPage()|public static|Return a string with the relative path to the current page.| |currentPageURI()|public static|Return a string with the path URL the current page (without the protocol).| |setCurrentPage()|public static|Define the segment of the current page.| |getSegment()|public static|Get any segment of the URI.| |getIgnoredSegment()|public static|Get any ignored segment of the URI.| |getAllSegments()|public static|Return the array of segments.| |getAllIgnoredSegments()|public static|Return the array of ignored segments.| |addSegment()|public static|Add a segment to the end of segments array.| |insertSegment()|public static|Insert a segment in any position of the segments array.| |_GET()|public static|Return the value of a query string variable.| |getParam()|public static|An alias to _GET() method.| |getParams()|public static|Return the array of query string variables.| |requestMethod()|public static|Return the request method string.| |removeParam()|public static|Remove a variable from the array of query string variables.| |setParam()|public static|Set value to a query string parameter.| |buildURL()|public static|Return the string of an URI with the received parameters.| |httpHost()|public static|Return the current host with protocol.| |_host()|private static|Return an URL host with protocolo.| |encode_param()|private static|Enconde an array of parameters into a query string.| |redirect()|public static|Set a redirect status header and finish the application.| |makeSlug()|public static|Generate a slug, removing the accented and special characters from a string and convert spaces into minus symbol.| |isAjaxRequest()|public static|Return true if is an XML HTTL request.| Methods DetailsparseURI()This method is invoked by the framework starter to initiate the internal properties. Do not call it in your application.
validateURI()This method performs the prevalidation to the current controller. It count the number of segments and validate against the uri configuration.
getControllerClass()This method return the name of the controller class.
Sample:
getURIString()Return the current URI string.
Sample:
currentPage()Return the content of the segment which represent the current page.
Sample:
relativePathPage()Return the content of the segment which represent the current page.
Sample:
currentPageURI()Return a string with the path URL the current page (without the protocol).
Sample:
setCurrentPage()Define the segment of the current page.
The Returns true if exists a Sample:
getSegment()Get any segment of the URI.
The The The Returns the value of the segment or false if it does not exists. Sample:
getIgnoredSegment()Get any ignored segment of the URI.
The Returns the value of the segment or false if it does not exists. Sample:
getAllSegments()Return the array of segments.
Sample:
getAllIgnoredSegments()Return the array of ignored segments.
Sample:
addSegment()Add a segment to the end of segments array.
The Sample:
insertSegment()Insert a segment in any position of the segments array.
The The Sample:
_GET()Return the value of a query string variable.
The Returns the value of the variable or false if it does not exists. Sample:
getParam()Return the value of a query string variable. Is an alias to _GET() method.
The Returns the value of the variable or false if it does not exists. Sample:
getParams()Return the array of query string variables.
Returns the array with all query string variables. Sample:
requestMethod()Return the request method string.
Sample:
removeParam()Remove a variable from the array of query string variables.
The Sample:
setParam()Set value to a query string parameter.
The The Sample:
buildURL()Return the string of an URI with the received parameters.
The The The The The Sample:
httpHost()Return the current host with protocol.
Sample:
redirect()Set a redirect status header and finish the application. This method sends the status header with a URI redirection to the user browser and finish the application execution.
The The Sample:
makeSlug()Generate a slug, removing the accented and special characters from a string and convert spaces into minus symbol.
The The The The Return the slug string. Sample:
isAjaxRequest()Return true if is an XML HTTL request. Test to see if a request contains the HTTP_X_REQUESTED_WITH header.
Return true if the request is an AJAX call. Sample:
|