Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony][Symfony2]Problem na starcie nauki
smiady
post
Post #1





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

Ostrzeżenie: (0%)
-----


Witam.

Zaczynam swoją przygodę z frameworkiem Somfony 2 i niestety mam problem na samym starcie. Otóż chce stworzyć zwykłą stronę hello world i wszystko robię z godnie z przykładem z książki "Symfony 2 Od podstaw". Wyskakuje mi taki błąd: NotFoundHttpException: No route found for "GET /hello-world.html"
Kombinowałem na wiele sposobów i nic to nie dało :/
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
smiady
post
Post #2





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

Ostrzeżenie: (0%)
-----


Pojawił się nowy problem:

Controller "My\HelloworldBundle\Controller\DefaultController::indexAction()" requires that you provide a value for the "$name" argument (because there is no default value or because there is a non optional argument after this one).

tak wyglada moj routing:

my_helloworld_homepage:
pattern: /
defaults: { _controller: MyHelloworldBundle:Default:index }

tak DefaultControler:


namespace My\HelloworldBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
public function indexAction($name)
{
return array();
}
}

a chce by byla otworzyla sie strona z pliku index.html.twig:

<HTML>
<HEAD>
<title>Hello world!</title>
</HEAD>
<BODY>
Hello world !
</BODY>
</HTML>

jak to zrobic ?

Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 12:15