problem s URL (No route for HTTP request)
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- Macaron
- Člen | 5
Mam problem s url → nemuzu se odkazat na presenter.
File structure:
app
|-presenters
|-|-LogIn
|-|-|-Presenters
|-|-|-templates
|-|-|-|-LogIn
Route create:
use Nette\StaticClass;
/**
* @return Nette\Application\IRouter
*/
public static function createRouter()
{
$router = new RouteList;
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepae:default');
$router[] = new Route('<presenter>/<action>[/<id>]', 'LogIn:default');
$router[] = new Route('<presenter>/<action>[/<id>]', 'Status:default'); //Sem se ale odkazat muzu
return $router;
}
Diky za radu.
- David Matějka
- Moderator | 6445
zkus smazat ty dalsi dve routy a nechat tam jen tu prvni. to
Homepage:default
je defaultni hodnota, ale ta routa je pouzitelna
i pro jiny presentery
- Macaron
- Člen | 5
Ale tohle funguje bez problemu jakto?
public static function createRouter()
{
$router = new RouteList;
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
$router[] = new Route('LogIn[/<id>]', 'LogIn:default');
$router[] = new Route('Status[/<id>]', 'Status:default');
return $router;
}
- exquis
- Člen | 83
Macaron napsal(a):
Mam problem s url → nemuzu se odkazat na presenter.
File structure:app |-presenters |-|-LogIn |-|-|-Presenters |-|-|-templates |-|-|-|-LogIn
Route create:
use Nette\StaticClass; /** * @return Nette\Application\IRouter */ public static function createRouter() { $router = new RouteList; $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepae:default'); $router[] = new Route('<presenter>/<action>[/<id>]', 'LogIn:default'); $router[] = new Route('<presenter>/<action>[/<id>]', 'Status:default'); //Sem se ale odkazat muzu return $router; }
Diky za radu.
Mas tam preklep – Homepae:default