PHP 클래스 CI_URI, TastyIgniter

Parses URIs and determines routing
저자: EllisLab Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$keyval array List of cached URI segments
$rsegments array Starts at 1 instead of 0.
$segments array Starts at 1 instead of 0.
$uri_string string Current URI string

보호된 프로퍼티들

프로퍼티 타입 설명
$_permitted_uri_chars string PCRE character group allowed in URI segments

공개 메소드들

메소드 설명
__construct ( ) : void Class constructor
assoc_to_uri ( array $array ) : string Assoc to URI
filter_uri ( string &$str ) : void Filter URI
rsegment ( integer $n, mixed $no_result = NULL ) : mixed Fetch URI "routed" Segment
rsegment_array ( ) : array Routed Segment Array
ruri_string ( ) : string Fetch Re-routed URI string
ruri_to_assoc ( integer $n = 3, array $default = [] ) : array Routed URI to assoc
segment ( integer $n, mixed $no_result = NULL ) : mixed Fetch URI Segment
segment_array ( ) : array Segment Array
slash_rsegment ( integer $n, string $where = 'trailing' ) : string Slash routed segment
slash_segment ( integer $n, string $where = 'trailing' ) : string Slash segment
total_rsegments ( ) : integer Total number of routed segments
total_segments ( ) : integer Total number of segments
uri_string ( ) : string Fetch URI string
uri_to_assoc ( integer $n = 3, array $default = [] ) : array URI to assoc

보호된 메소드들

메소드 설명
_parse_argv ( ) : string Parse CLI arguments
_parse_query_string ( ) : string Parse QUERY_STRING
_parse_request_uri ( ) : string Parse REQUEST_URI
_remove_relative_directory ( string $uri ) : string Remove relative directory (.
_set_uri_string ( string $str ) : void Set URI String
_slash_segment ( integer $n, string $where = 'trailing', string $which = 'segment' ) : string Internal Slash segment
_uri_to_assoc ( integer $n = 3, array $default = [], string $which = 'segment' ) : array Internal URI-to-assoc

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( ) : void
리턴 void

_parse_argv() 보호된 메소드

Take each command line argument and assume it is a URI segment.
protected _parse_argv ( ) : string
리턴 string

_parse_query_string() 보호된 메소드

Will parse QUERY_STRING and automatically detect the URI from it.
protected _parse_query_string ( ) : string
리턴 string

_parse_request_uri() 보호된 메소드

Will parse REQUEST_URI and automatically detect the URI from it, while fixing the query string if necessary.
protected _parse_request_uri ( ) : string
리턴 string

_remove_relative_directory() 보호된 메소드

./) and multi slashes (///) Do some final cleaning of the URI and return it, currently only used in self::_parse_request_uri()
protected _remove_relative_directory ( string $uri ) : string
$uri string
리턴 string

_set_uri_string() 보호된 메소드

Set URI String
protected _set_uri_string ( string $str ) : void
$str string
리턴 void

_slash_segment() 보호된 메소드

Fetches an URI Segment and adds a slash to it.
protected _slash_segment ( integer $n, string $where = 'trailing', string $which = 'segment' ) : string
$n integer Index
$where string Where to add the slash ('trailing' or 'leading')
$which string Array name ('segment' or 'rsegment')
리턴 string

_uri_to_assoc() 보호된 메소드

Generates a key/value pair from the URI string or re-routed URI string.
protected _uri_to_assoc ( integer $n = 3, array $default = [], string $which = 'segment' ) : array
$n integer Index (default: 3)
$default array Default values
$which string Array name ('segment' or 'rsegment')
리턴 array

assoc_to_uri() 공개 메소드

Generates a URI string from an associative array.
public assoc_to_uri ( array $array ) : string
$array array Input array of key/value pairs
리턴 string URI string

filter_uri() 공개 메소드

Filters segments for malicious characters.
public filter_uri ( string &$str ) : void
$str string
리턴 void

rsegment() 공개 메소드

Returns the re-routed URI segment (assuming routing rules are used) based on the index provided. If there is no routing, will return the same result as CI_URI::segment().
또한 보기: CI_URI::$rsegments
또한 보기: CI_URI::segment()
public rsegment ( integer $n, mixed $no_result = NULL ) : mixed
$n integer Index
$no_result mixed What to return if the segment index is not found
리턴 mixed

rsegment_array() 공개 메소드

Routed Segment Array
public rsegment_array ( ) : array
리턴 array CI_URI::$rsegments

ruri_string() 공개 메소드

Fetch Re-routed URI string
public ruri_string ( ) : string
리턴 string

ruri_to_assoc() 공개 메소드

Identical to CI_URI::uri_to_assoc(), only it uses the re-routed segment array.
또한 보기: CI_URI::uri_to_assoc()
public ruri_to_assoc ( integer $n = 3, array $default = [] ) : array
$n integer Index (default: 3)
$default array Default values
리턴 array

segment() 공개 메소드

Fetch URI Segment
또한 보기: CI_URI::$segments
public segment ( integer $n, mixed $no_result = NULL ) : mixed
$n integer Index
$no_result mixed What to return if the segment index is not found
리턴 mixed

segment_array() 공개 메소드

Segment Array
public segment_array ( ) : array
리턴 array CI_URI::$segments

slash_rsegment() 공개 메소드

Fetches an URI routed segment with a slash.
public slash_rsegment ( integer $n, string $where = 'trailing' ) : string
$n integer Index
$where string Where to add the slash ('trailing' or 'leading')
리턴 string

slash_segment() 공개 메소드

Fetches an URI segment with a slash.
public slash_segment ( integer $n, string $where = 'trailing' ) : string
$n integer Index
$where string Where to add the slash ('trailing' or 'leading')
리턴 string

total_rsegments() 공개 메소드

Total number of routed segments
public total_rsegments ( ) : integer
리턴 integer

total_segments() 공개 메소드

Total number of segments
public total_segments ( ) : integer
리턴 integer

uri_string() 공개 메소드

Fetch URI string
public uri_string ( ) : string
리턴 string CI_URI::$uri_string

uri_to_assoc() 공개 메소드

Generates an associative array of URI data starting at the supplied segment index. For example, if this is your URI: example.com/user/search/name/joe/location/UK/gender/male You can use this method to generate an array with this prototype: array ( name => joe location => UK gender => male )
public uri_to_assoc ( integer $n = 3, array $default = [] ) : array
$n integer Index (default: 3)
$default array Default values
리턴 array

프로퍼티 상세

$_permitted_uri_chars 보호되어 있는 프로퍼티

PCRE character group allowed in URI segments
protected string $_permitted_uri_chars
리턴 string

$keyval 공개적으로 프로퍼티

List of cached URI segments
public array $keyval
리턴 array

$rsegments 공개적으로 프로퍼티

Starts at 1 instead of 0.
public array $rsegments
리턴 array

$segments 공개적으로 프로퍼티

Starts at 1 instead of 0.
public array $segments
리턴 array

$uri_string 공개적으로 프로퍼티

Current URI string
public string $uri_string
리턴 string