Я склоняюсь к Phalcon с несколькими модулями. Со структурой.Phalcon ajenti config для запуска нескольких модулей на моем сайте
- apps
- frontend
controllers
models
views
Modules.php
- backend
controllers
models
views
Modules.php
- public
css
js
img
index.php
И Nginx конфигурации:
server {
listen *:80 default_server;
server_name localhost.dev;
access_log /var/log/nginx/localhostdev.access.log;
error_log /var/log/nginx/localhostdev.error.log;
root /srv/localhost.dev/public;
index index.html index.htm index.php;
set $root_path '/srv/localhost.dev/public';
location/{
root $root_path;
index index.php index.html index.htm;
# if file exists return it right away
if (-f $request_filename) {
break;
}
# otherwise rewrite it
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?_url=$1 last;
break;
}
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ [^/]\.php(/|$) {
fastcgi_index index.php;
include fcgi.conf;
fastcgi_pass unix:/var/run/ajenti-v-php-fcgi-localhostdev-php-fcgi-0.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Публично/index.php:
$di->set('router', function()
{
$router = new Router();
$router->setDefaultModule("frontend");
$router->add('/:module/:controller/:action/:params', array(
'module' => 1,
'controller' => 2,
'action' => 3,
'params' => 4
));
return $router;
});
Когда я получить доступ к localhost.dev:
it print: Hello Frontend!
Но я получить доступ к localhost.dev/frontend
распечатать: Frontend \ Контроллеры \ BackendController класс обработчик не может быть загружен
Как это исправить?
Дополнительный вопрос.
Что я должен конфиг в Nginx:
root /srv/localhost.dev;
# nginx configuration
location/{
rewrite ^/$ /public/ break;
rewrite ((?s).*) /public/$1 break;
}
location /public/ {
if (!-e $request_filename){
rewrite ^/((?s).*)$ /index.php?_url=/$1 break;
}
}
или
root /srv/localhost.dev/public;
# if file exists return it right away
if (-f $request_filename) {
break;
}
# otherwise rewrite it
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?_url=$1 last;
break;
}