PHP 클래스 Noherczeg\Breadcrumb\Breadcrumb

파일 보기 프로젝트 열기: noherczeg/breadcrumb 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $base_url = null, $config = 'en' )
append ( String $raw_name = null, String $side = 'right', boolean $base = false, mixed $translate = true, boolean $disabled = false ) : Breadcrumb append: Appends an element to the list of Segments. Can do it from both sides, and can mark an element as base element, which means that it'll point to the base URL.
build ( String $format = null, String | null $casing = null, boolean $last_not_link = true, String | null $separator = null, array $customizations = [], boolean $different_links = false ) : String Builder method which returns with a result type as required.
disable ( integer $pos = null ) : Breadcrumb Disables a Segment at the given position.
from ( mixed $input = null ) : Breadcrumb from: Reads the first parameter which can be a String, PHP array, JSON array and creates + appends Segments from it in one step.
map ( array $rawArray ) : Breadcrumb Registers a list of title => link pairs with the package.
num_of_segments ( ) : integer num_of_segments: Returns the number of segments which are registered in the system.
registered ( ) : array registered: Returns all the registered Segments.
remove ( integer $pos, boolean $reindex_after_remove = false ) : Breadcrumb remove: Removes an element from the list, optionally can reindex the list after removal.
segment ( String $id ) : Segment segment: A getter which returns the Segment which is at the given position.
setBaseURL ( String $urlString ) : Breadcrumb Sets the base URL for the package.
setConfiguration ( mixed $config ) : Breadcrumb Dynamic Package configuration

비공개 메소드들

메소드 설명
appendToSide ( $segment, $side )
checkAppendArgs ( $raw_name, $side )
checkFromArgs ( $input )
inputToArray ( $input = null )
loadBuilders ( ) : array
safeArrayAssignment ( $input ) : array
setParam ( mixed $to_this ) : String setParam: basic system method, don't bother.

메소드 상세

__construct() 공개 메소드

public __construct ( $base_url = null, $config = 'en' )

append() 공개 메소드

Supports method chaining. Warning! It doesn't fix multiple "base element" issues, so it's up to the programmer to append base elements wisely!
public append ( String $raw_name = null, String $side = 'right', boolean $base = false, mixed $translate = true, boolean $disabled = false ) : Breadcrumb
$raw_name String Name of the appendable Segment
$side String Which side to place the segment in the array
$base boolean true if it is referring to the base url
$translate mixed Set to true if you want to use the provided dictionary, set to false if you want to skip translation, or set to a specific string to assign that value
$disabled boolean
리턴 Breadcrumb

build() 공개 메소드

Supports separator switching, casing switching, and custom property insertion from an array (only if output is set to html!).
public build ( String $format = null, String | null $casing = null, boolean $last_not_link = true, String | null $separator = null, array $customizations = [], boolean $different_links = false ) : String
$format String Format of the output
$casing String | null Casing of Segments
$last_not_link boolean
$separator String | null Separator String (not there in Foundation!)
$customizations array Array of properties (only in HTML!)
$different_links boolean
리턴 String

disable() 공개 메소드

Segment will still remain, but won't be translated, and will be handled specially in the building process. Supports method chaining.
public disable ( integer $pos = null ) : Breadcrumb
$pos integer Position of the element
리턴 Breadcrumb

from() 공개 메소드

Supports method chaining.
public from ( mixed $input = null ) : Breadcrumb
$input mixed Either: PHP array, JSON array, URI string
리턴 Breadcrumb

map() 공개 메소드

All of the given data will be used as-is no translation, no URL conversion will be applied!
public map ( array $rawArray ) : Breadcrumb
$rawArray array Array with title => link pairs
리턴 Breadcrumb

num_of_segments() 공개 메소드

num_of_segments: Returns the number of segments which are registered in the system.
public num_of_segments ( ) : integer
리턴 integer

registered() 공개 메소드

registered: Returns all the registered Segments.
public registered ( ) : array
리턴 array

remove() 공개 메소드

Supports method chaining.
public remove ( integer $pos, boolean $reindex_after_remove = false ) : Breadcrumb
$pos integer Position of the element
$reindex_after_remove boolean To do the reindex or not
리턴 Breadcrumb

segment() 공개 메소드

segment: A getter which returns the Segment which is at the given position.
public segment ( String $id ) : Segment
$id String The ID of the required Segment.
리턴 Segment

setBaseURL() 공개 메소드

Sets the base URL for the package.
public setBaseURL ( String $urlString ) : Breadcrumb
$urlString String Base URL
리턴 Breadcrumb

setConfiguration() 공개 메소드

Dynamic Package configuration
public setConfiguration ( mixed $config ) : Breadcrumb
$config mixed Configurations (either lang code as String, or configuration array)
리턴 Breadcrumb