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

Simple Modular Project Not Working

I want to create simple multi moudle phalcon project, but it is not working even with on module

I just followed these steps :

  1. Create Project : phalcon project mod --type=moudles
  2. Enable Webtools : phalcon webtools --action=enable
  3. Create simple scafoold with webtools

My project has only one moudle with frontend name.

but when I open the controller url, I get this problem :

**( ! ) Fatal error: Class 'ControllerBase' not found in C:\wamp\www\mod\apps\frontend\controllers\AdminmenuController.php on line 7**
Call Stack
#   Time    Memory  Function    Location
1   0.0171  245464  {main}( )   ..\index.php:0
2   0.0289  262960  handle ( )  ..\index.php:30
3   0.0482  305744  dispatch ( )    ..\index.php:30
4   0.0482  306528  spl_autoload_call ( )   ..\index.php:0
5   0.0482  306640  autoLoad ( )    ..\index.php:0
6   0.0490  362624  Phalcon\Loader->autoLoad( ) ..\index.php:0


98.9k
edited Sep '14

I think your class needs a namespace to load the ControllerBase successfully in a namespace based application: https://github.com/phalcon/biko/blob/master/apps/frontend/controllers/CartController.php#L3



2.3k

Hi

Thanks for the answer, I have used namespace, but now it do not load any Model in controller