view did not rendering when use dispatcher forward method

if use dispathcer 's forward mehtod , the forward action will execute, but the forward view can not rendering.

example: public funciton indexaction{ $this->dispatcher->forward(['controller' => 'index','action' => 'index2']); }

public function index2action{

}

if visit index2 direct ,the index2's view vill rendering, but visit index method, the index2's view can not rendering

my php version is 5.6.10 and my phalcon vsersion is 2.0.7



67.6k

if you try with return in front ?


public function indexAction() {
    return $this->dispatcher->forward([
        'controller' => 'index',
        'action' => 'index2'
    ]);
}


627

it not work...

if you try with return in front ?


public function indexAction() {
   return $this->dispatcher->forward([
       'controller' => 'index',
       'action' => 'index2'
   ]);
}


67.6k

give us a bit more details then. i use it like that and it works.

Give us how you define your View service, you folder structure, single module app or multi ? If multi show us Module.php -> function registerServices()



627

long ago ,I use 1.3.4 , it was work , but now I upgrade 2.0.7 , it doesn't work....

give us a bit more details then. i use it like that and it works.

Give us how you define your View service, you folder structure, single module app or multi ? If multi show us Module.php -> function registerServices()



627

yes, what is your phalcon version

did you follow this guide https://blog.phalconphp.com/post/guide-upgrading-to-phalcon-2



67.6k

2.1, i havent work with version 1, so cant really help you. Sorry.

some exmaples that should be able to help you : https://github.com/phalcon/mvc



627

thank you ! I will try 2.1 later. I hope other people can hepl me. thank you very much!

2.1, i havent work with version 1, so cant really help you. Sorry.

some exmaples that should be able to help you : https://github.com/phalcon/mvc