We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Routing in micro collection

Hi... I'm new in phalcon and try to make a simple api using phalcon micro and micro collection. I'm try to make a route which can be access through POST and GET method. this is a piece of code i'm using

$myMicroCollectionObj = new \Phalcon\Mvc\Micro\Collection();




and i get this error message :

Uncaught Error: Call to undefined method Phalcon\Mvc\Micro\Collection::via()



The "via" option is a config only for "micro" class, not his childrens...

You can alternate this doing:`


Here some example used in this forum:


edited Dec '16

via() method does not exist in MicroCollection. Simple as that.

class Collection implements \Phalcon\Mvc\Micro\CollectionInterface