current position:Home>YAF CLI and HTTP access modes

YAF CLI and HTTP access modes

2022-04-29 10:22:42Legendary fat man

  Please note that Yaf edition , test 3.2.5 Version in cli In mode Yaf_Request_Simple Can't set $params

//php yaf.php test/test/test aaa bbb    #aaa,bbb Is the parameter 

$application = new Yaf_Application( APPLICATION_PATH . "/conf/application.ini");

    // load cli Of bootstrap Configure the content 

    $uri_r = explode('/',$argv[1]);
        exit('uri error!');
    list($module,$controller,$action) = $uri_r;
    $params = array_slice($argv,2);

    // Modification request 
    $Request = new Yaf_Request_Simple('CLI',$module,$controller,$action,$params);
    // start-up 

Use in calling methods $this->getRequest()->getParams() To obtain parameters

copyright notice
author[Legendary fat man],Please bring the original link to reprint, thank you.

Random recommended