Replies: 2 comments 2 replies
-
You will need to "tell" your application where your classes are. I don't recall the structure that the devtools creates but assume that you have something like this:
and that your You can either use the Phalcon Loader or composer - whichever is easier for you. You will need to register the namespace and tell the loader where your files are. Assume that composer
or Phalcon Loader: <?php
use Phalcon\Loader;
$loader = new Loader();
$loader->registerNamespaces(
[
'MyProject\Controllers' => 'app/controllers',
'MyProject\Models' => 'app/models',
]
);
$loader->register(); For the Phalcon Loader, you can add that either in a |
Beta Was this translation helpful? Give feedback.
-
You can also have a look at Vokuro: https://github.com/phalcon/vokuro It has a lot of Phalcon's functionality that you can utilize for your own project |
Beta Was this translation helpful? Give feedback.
-
Okay, I'm just trying to get started with Phalcon, taking the first tutorial to create an application called store.
Phalcon and the dev-tools are installed on ubuntu 20.04 with apache2 and php7.4
I type phalcon at the command prompt and get the basic help list as in the example. At the command prompt I'm in the root directory of /var/www/html, when I create the application with phalcon --create-project store. I cd to the store folder and do an ls -al to be sure the application structure is there and it is.
Now, in my browser I type localhost/store and I get the following:
StoreController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->throwDispatchException('StoreController...', 2)
#1 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#2 /var/www/html/store/public/index.php(43): Phalcon\Mvc\Application->handle('/store/')
#3 {main}
What am I missing here. I've followed the very simple instructions to get this far. I'd really like to make use of phalcon and need someone to help me at least get started. I've searched the web and phalcon discussion groups and have found similar problems but, they are several years old and do not provide a viable solution.
Please help!
Beta Was this translation helpful? Give feedback.
All reactions