Yaf_Controller_Abstract::forward

(Yaf >=1.0.0)

Yaf_Controller_Abstract::forwardForward to another action

Açıklama

publicYaf_Controller_Abstract::forward(string$action, array$paramters = ?): bool
publicYaf_Controller_Abstract::forward(string$controller, string$action, array$paramters = ?): bool
publicYaf_Controller_Abstract::forward(
    string$module,
    string$controller,
    string$action,
    array$paramters = ?
): bool

forward current execution process to other action.

Bilginize:

this method doesn't switch to the destination action immediately, it will take place after current flow finish.

Bağımsız Değişkenler

module

destination module name, if NULL was given, then default module name is assumed

controller

destination controller name

action

destination action name

paramters

calling arguments

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Örnekler

Örnek 1 Yaf_Controller_Abstract::forward()example

<?php
class IndexController extends Yaf_Controller_Abstract
{
public function
indexAction(){
$logined = $_SESSION["login"];
if (!
$logined) {
$this->forward("login", array("from" => "Index")); // forward to login action
return FALSE; // this is important, this finish current working flow

Yukarıdaki örnek şuna benzer bir çıktı üretir:

login, redirected from Index action

Ayrıca Bakınız

  • Yaf_Request_Abstrace::getParam()
To Top