Yaf_Request_Simple::__construct

(Yaf >=1.0.0)

Yaf_Request_Simple::__constructConstructor of Yaf_Request_Simple

Description

public function Yaf_Request_Simple::__construct(
    string $method = ?,
    string $module = ?,
    string $controller = ?,
    string $action = ?,
    array $params = ?
)

Warning

This function is currently not documented; only its argument list is available.

Parameters

This function has no parameters.

Return Values

Examples

Example #1 Yaf_Request_Simple::__construct() example

<?php
/**
 * In a CLI script, build a request that skips the routing
 * process by giving the MVC names directly.
 */
$request = new Yaf_Request_Simple(
    "CLI",            // method
    "Index",          // module
    "Product",        // controller
    "detail",         // action
    array("id" => 10) // request parameters
);

var_dump($request->isRouted()); /* requests with MVC names are pre-routed */
var_dump($request->getModuleName());
var_dump($request->getControllerName());
var_dump($request->getActionName());
var_dump($request->getParam("id"));
?>

The above example will output something similar to:

bool(true)
string(5) "Index"
string(7) "Product"
string(6) "detail"
int(10)

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.