\lfrequest

Parses $_SERVER['REQUEST_URI'] into usable parts, generates a fake REQUEST_URI, etc if it is not set.

  • Action is between Cwd and Param.
  • Action takes/gives from/to Cwd and takes/gives from/to Param.
  • Action is the only one that needs to be moving stuff around.

Check it out:

<?php pre( (new \lf\request)->load()->actionPush() ); ?>

Summary

Methods
Properties
Constants
parse()
save()
load()
getPieces()
getCwd()
getAction()
getParam()
getDomain()
getSubdirUrl()
getLfUrl()
getIndexUrl()
getAdminUrl()
getActionUrl()
fakeServerGlobal()
paramShift()
actionPop()
actionDrop()
actionCount()
actionUndrop()
fullActionPop()
actionKeep()
isAdmin()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$pieces
N/A

Properties

$pieces

$pieces : 

Type

Methods

parse()

parse(  $uri = null) 

Parse REQUEST_URI into `$pieces`

Parameters

$uri

save()

save() 

Save pieces to session for later `load()`

load()

load() 

Load pieces from session, parse if null then save to session, return $this

getPieces()

getPieces() 

Return private `pieces`, but you should avoid relying on this.

getCwd()

getCwd() 

Return `cwd` array piece

getAction()

getAction() 

Return `action` array piece

getParam()

getParam() 

Return `param` array piece

getDomain()

getDomain() 

Return `domain` string. eg, `www.domain.com`

getSubdirUrl()

getSubdirUrl() 

Return string of full URL to subdir `lf/` is installed under.

eg, http://www.domain.com/littlefoot/

getLfUrl()

getLfUrl() 

Return string of full public URL to the `lf/` folder

eg, http://www.domain.com/littlefoot/lf/

getIndexUrl()

getIndexUrl() 

Return string of `subdir/(index.php/)?` depending on if rewrite setting is enabled

eg, http://www.domain.com/littlefoot/index.php/

getAdminUrl()

getAdminUrl() 

Return string of `subdir/(index.php/)?admin/`

eg, http://www.domain.com/littlefoot/index.php/admin/

getActionUrl()

getActionUrl() 

Return string of `subdir/(index.php/)?action[0]/action[1]/.

../action[n]/`

eg, http://www.domain.com/littlefoot/index.php/blog/

fakeServerGlobal()

fakeServerGlobal(  $requestUri = '/') 

Parameters

$requestUri

paramShift()

paramShift(  $count = 1) 

Parameters

$count

actionPop()

actionPop(  $count = 1) 

Parameters

$count

actionDrop()

actionDrop(  $count = 1) 

Parameters

$count

actionCount()

actionCount() 

actionUndrop()

actionUndrop(  $count = 1) 

Parameters

$count

fullActionPop()

fullActionPop() 

actionKeep()

actionKeep(  $count = 1) 

I don't like the name. but this pushes all action to param, and pulls back $count

Parameters

$count

isAdmin()

isAdmin()