Menu URL protocol

Get URI of a menu item.

After MENU PROTOCOL

2. Build URI menu structure

Build backend URI menu structure, here you can customize the premalink for each item.

// Find items URI by permalink
echo $protocol->findURI("contact"); 

Result: /about/contact


// Find items URI by id
echo $protocol->findURI(12, true); 

Result: /about/contact

Complete function list

CT nest - builder
Version: 3.5
Copyright: All right reserved for Creative Army
__construct($array)
CT nest - protocol
Version: 3.5
Copyright: All right reserved for Creative Army
static _init()
Change how to handle start/root page of protocol. Will use argument array instead as param/uri array
@param array $arr uri array
@return self
startParamSet(?array $arr)
Check if current page is the start page
@return boolean
isStart()
List all protocol data
@return array
list()
Get current protocol data
@return array
data()
Get current protocol data
@return array
current()
Modify protocol item
@param int $id Item ID
@param array $uri add URI to URI
@param string $append append, prepend or replace
@return self
modifyProtocol(int $id, array $uri, string $type = "append")
Find and protocol item with key
@param key $p
@return string/bool item / false
exists($p)
Return URI if key (table column) mathes value
@param key $p
@param string $value
@return string/bool string (URI) / false
searchURI($key, $value)
Return ROW if key (table column) mathes value
@param key $p
@param string $value
@return string/bool string (URI) / false
search($key, $value)
Find and URI with key
@param key $p
@return string/bool string (URI) / false
findURI($p, ?int $byID = NULL)
Get URI By permalink
@param string $id (string becouse of addes duplicate preflix)
@return string
getURI(?string $permalink)
Get full URI as Array
@param string $id (string becouse of addes duplicate preflix)
@return string
getURIArray(?string $permalink)
Get data from URI ARRAY
@param array $arr URI items
@return Array
feedFromArray(array $arr)
Get URI By id
@param string $id (string becouse of addes duplicate preflix)
@return string
getURIByID(string $id)
Get Data By permalink
@param string $id (string becouse of addes duplicate preflix)
@return array
getData(?string $permalink)
Get Data By ID
@param string $id (string becouse of addes duplicate preflix)
@return array
getDataByID(string $id)
Find and the URI before the key
@param key $p
@return string/bool string (URI) / false
before($p, ?int $index = NULL)
Find and the URI after the key
@param key $p
@return string/false
after($p)
Find and the URI after the key
@param key $p
@return string/false
afterAll($p)
Get index/position of item in protocol list
@param string $key the prermalink
@return INT list item index
index($key)
Add to item to protocol
@param array $params URI array
@param int $parent parent ID // not used, will be removed, just set 0
@param int $id id
add($params, $parent, $id, $data)
Change paramArr part
@param array $p URI part Array
@return self
part($p)
Will start validating header status
@param array/false $p URI Part Array
@return self
get($p = false)