Modularna aplikacia a problem s routovanim
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- cujan
- Člen | 410
Caute, mam aplikaciu rozdelenu na moduly Admin a Front a probllem je, ze ak
pristupujem na front tak mi natiahne len Homepage a ak pristupujem ku ostanym
presenterom tak mi hodi hlasku
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
a teraz neviem ci je problem v nette alebo nas erveri, lebo admin routovanie mi funguje v pohode..
<?php
<?php
namespace App;
use Nette,
Nette\Application\Routers\RouteList,
Nette\Application\Routers\Route,
Nette\Application\Routers\SimpleRouter;
/**
* Router factory.
*/
class RouterFactory
{
/**
* @return \Nette\Application\IRouter
*/
public function createRouter()
{
$router = new RouteList();
$router[] = new Route('index.php', 'Front:Homepage:default', Route::ONE_WAY);
# admin
$router[] = $adminRouter = new RouteList('Admin');
$adminRouter[] = new Route('admin/[<lang [a-z]{2}>/]<presenter>/<action>[/<id>]', 'Homepage:default');
# front
$router[] = $frontRouter = new RouteList('Front');
/**$frontRouter[] = new Route('[<lang [a-z]{2}>/]<presenter>/<action>[/<id>]', 'Homepage:default');*/
$frontRouter[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
return $router;
}
}
?>
- cujan
- Člen | 410
cujan napsal(a):
No neviem lebo admin module mi funguje bez problemov…
a dokonca ak zadam do front routu na zaciatok /FRONT tak to funguje…
cize ak zadam …www/front/ a routa je v tvare
<?php
$frontRouter[] = new Route('/front/<presenter>/<action>[/<id>]', 'Homepage:default');
?>
Editoval cujan (10. 2. 2014 20:55)