Why does the yaf framework access route always access the INDEX method under the INDEX controller under INDEX

1. Recently learn yaf to see the manual said default routing, after a series of installation, enter the URL to show Hello World! I am Stranger this is normal!

2. But I create a new public function testAction method in the Index.php file under controlers . Routing access http://sitename/Index/Index/test, always accesses the contents of the indexAction method!

3. Ask for God"s guidance! (also: if I want to classify the controller, for example, the directory is controllers/son/son.php , the controller in this file inherits the controllers/father.php directory format, how should I set the route?)

4. The table of contents and various configurations are attached below!

< hr > < H2 > Nginx configuration < / H2 >
        location / {
                try_files $uri $uri/ /index.php;

                if (!-e $request_filename) {
                        rewrite ^(.*)$ /index.php?s=$1 last;
                        break;
               }
               -sharp 
            -sharp    if (!-e $request_filename) {
            -sharp        rewrite ^/(.*) /index.php/$1 last;
            -sharp    }
        }
< H2 > Index Controller < / H2 >
<?php
/**
 * @name IndexController
 * @author root
 * @desc 
 * @see http://www.php.net/manual/en/class.yaf-controller-abstract.php
 */
class IndexController extends Yaf_Controller_Abstract {

    /** 
     * 
     * YafYaf_Request_Abstract::getParam()Action
     * , http://yourhost/demo/index/index/index/name/root , 
     */
    public function indexAction($name = "Stranger") {
        //1. fetch query
        $get = $this->getRequest()->getQuery("get", "default value");

        //2. fetch model
        $model = new SampleModel();

        //3. assign
        $this->getView()->assign("content", $model->selectSample());
        $this->getView()->assign("name", $name);

        //4. render by Yaf, FALSE, YafRender
        return TRUE;
    }

    public function testAction()
    {
        echo "this is a test of router";
    }
}

ask all bosses to answer questions and questions!

Jul.07,2021

has been resolved. Yaf does not support PATH_INFO mode. After route rewriting, you can turn off PATH_INFO mode


  

Why do you have such a strange idea? Does the controller have inheritance?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3191b-2bd97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3191b-2bd97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?