I am new to PHALCON
I create a project, and this is the folder struture:
wsph
+--app
¦ +--config
¦ +--controllers
¦ ¦ +--wsget
¦ ¦ +-- WmsController.php
¦ ¦ ¦
¦ +--library
¦ +--migrations
¦ +--models
¦ +--views
¦ +--layouts
+--cache
+--public
My Router file is:
<?php
$router = $di->getRouter();
// Define your routes here
$router->add(
"/wsget/:controller/:action",
[
"controller" => 1,
"action" => 2,
"namespace" => "App\Controllers\Wsget"
]
);
$router->handle();
My Loader file is:
<?php
$loader = new \Phalcon\Loader();
/**
* We're a registering a set of directories taken from the configuration file
*/
$loader->registerDirs(
[
$config->application->controllersDir,
$config->application->modelsDir,
]
);
$loader->registerNamespaces(
[
'App\Controllers\Wsget' => 'app/controllers/wsget',
]
);
$loader->register();
My controller is :
namespace App\Controllers\Wsget;
use Phalcon\Mvc\Controller;
class WmsController extends Controller
{
public function SalesAction() { echo json_encode( [ 'erro' => 8500, 'msg' => 'OK!!!!'] ); }
}
The Url i need to access for this controller is: localhost:8083/wsget/wms/sales
How to make this URL work?
Thanks in advance