PHP 8.4.0 RC4 available for testing

Yaf_Action_Abstract::execute

(Yaf >=1.0.0)

Yaf_Action_Abstract::executeAction entry point

Descrição

abstract publicYaf_Action_Abstract::execute(mixed ...$args): mixed

user should always define this method for a action, this is the entry point of an action. Yaf_Action_Abstract::execute() may have agruments.

Nota:

The value retrived from the request is not safe. you should do some filtering work before you use it.

Parâmetros

args

Valor Retornado

Exemplos

Exemplo #1 Yaf_Action_Abstract::execute()example

<?php
/**
* A controller example
*/
class ProductController extends Yaf_Controller_Abstract {
protected
$actions = array(
"index" => "actions/Index.php",
);
}
?>

Exemplo #2 Yaf_Action_Abstract::execute()example

<?php
/**
* ListAction
*/
class ListAction extends Yaf_Action_Abstract {
public function
execute ($name, $id) {
assert($name == $this->getRequest()->getParam("name"));
assert($id == $this->getRequest()->getParam("id"));
}
}
?>

O exemplo acima produzirá algo semelhante a:

/**
 * Now assuming we are using the Yaf_Route_Static route 
 * for request: http://yourdomain/product/list/name/yaf/id/22
 * will result:
 */
 bool(true)
 bool(true)

Veja Também

adicione uma nota

Notas Enviadas por Usuários (em inglês)

Não há notas de usuários para esta página.
To Top