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

Multiple Modules in one View

First of all Hello!

Guys. I am writing an aplication using Phalcon. I wrote a list of elements in one action controlller and in second controller I wrote form to edit some single rows. I used single module architecture. I think that was wrong because I would like to show both modules on one site - under one url. Can or should I use multi module architecture to show both modules in one view? How to do it correctly? I have pages where I would like to show 5 or 6 modules at once.

Ty for Your help.



10.0k

It's wrong. But you can do this.

IndexController:

public functiom IndexAction(){
    (new AnotherController())->echoElement();
}

AnotherController:

public function echoElemen(){ //Without trailing word Action
    echo "<a href='#'></a>";
}

And don't forget call {{ content() }} from last view.