Controller
+ Inheritance diagram for Controller:

Description

A controller.

Protected Properties

array array $extra
 Extra arguments from the router. More...
 
array $path
 The path's regex match from routing. More...
 
Site $site
 

Public Methods

 __call (string $method, array $args)
 Throws HTTP 501 Not Implemented as a catch-all for any unimplemented non-standard request methods. More...
 
 __construct (Site $site, array $path, array $extra=[])
 
void string View delete ()
 Handles DELETE More...
 
void string View get ()
 Handles GET More...
 
 head ()
 Handles HEAD More...
 
bool offsetExists ($offset)
 
null mixed offsetGet ($offset)
 
void offsetSet ($offset, $value)
 
void offsetUnset ($offset)
 
void string View post ()
 Handles POST More...
 
void string View put ()
 Handles PUT More...
 

Protected Methods

 redirect_exit (string $path, int $code=302)
 Forwards to Response::redirect_exit(). More...
 

Properties

◆ $extra

array array $extra
protected

Extra arguments from the router.

◆ $path

array $path
protected

The path's regex match from routing.

ArrayAccess forwards to this.

Constructor

◆ __construct()

__construct ( Site  $site,
array  $path,
array  $extra = [] 
)
Parameters
Site$site
string[]$path
array$extra

Methods

◆ __call()

__call ( string  $method,
array  $args 
)
final

Throws HTTP 501 Not Implemented as a catch-all for any unimplemented non-standard request methods.

Parameters
string$method
array$args

◆ delete()

void string View delete ( )

Handles DELETE

This stub throws HTTP 501 Not Implemented

Returns
void|string|View

◆ get()

void string View get ( )

Handles GET

This stub throws HTTP 501 Not Implemented

Returns
void|string|View

◆ head()

head ( )

Handles HEAD

This stub returns from Controller::get()

◆ offsetExists()

bool offsetExists (   $offset)
Parameters
mixed$offset
Returns
bool

◆ offsetGet()

null mixed offsetGet (   $offset)
Parameters
mixed$offset
Returns
null|mixed Coalesces to null

◆ offsetSet()

void offsetSet (   $offset,
  $value 
)
Parameters
mixed$offset
mixed$value

◆ offsetUnset()

void offsetUnset (   $offset)
Parameters
mixed$offset

◆ post()

void string View post ( )

Handles POST

This stub throws HTTP 501 Not Implemented

Returns
void|string|View

◆ put()

void string View put ( )

Handles PUT

This stub throws HTTP 501 Not Implemented

Returns
void|string|View

◆ redirect_exit()

redirect_exit ( string  $path,
int  $code = 302 
)
protected

Forwards to Response::redirect_exit().

Parameters
string$path
int$code