We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



85.5k

if you try with return in front ?


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


1.2k

it not work...

if you try with return in front ?


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


85.5k

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()



1.2k

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()



1.2k

yes, what is your phalcon version

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



85.5k

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



1.2k

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