downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Yaf_Plugin_Abstract::routerStartup> <Yaf_Plugin_Abstract::preResponse
[edit] Last updated: Fri, 17 May 2013

view this page in

Yaf_Plugin_Abstract::routerShutdown

(Yaf >=1.0.0)

Yaf_Plugin_Abstract::routerShutdownThe routerShutdown purpose

Descrierea

public void Yaf_Plugin_Abstract::routerShutdown ( Yaf_Request_Abstract $request , Yaf_Response_Abstract $response )

This hook will be trigged after the route process finished, this hook is usually used for login check.

Avertizare

Această funcție nu este documentată în prezent; este disponibilă numai lista sa de argumente.

Parametri

request

response

Valorile întoarse

Exemple

Example #1 Yaf_Plugin_Abstract::routerShutdown()example

<?php
class UserInitPlugin extends Yaf_Plugin_Abstract {

    public function 
routerShutdown(Yaf_Request_Abstract $requestYaf_Response_Abstract $response) {
        
$controller $request->getControllerName();

        
/**
         * Use access controller is unecessary for APIs
         */
        
if (in_array(strtolower($controller), array(
            
'api',  
        ))) {
            return 
TRUE;
        }
       
        if (
Yaf_Session::getInstance()->has("login")) {
            return 
TRUE;
        }
 
        
/* Use access check failed, need to login */
        
$response->redirect("http://yourdomain.com/login/");
        return 
FALSE;
    }
?>

Vedeți de asemenea



add a note add a note User Contributed Notes Yaf_Plugin_Abstract::routerShutdown - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites