Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [Symfony][SF2][Symfony2] problem na poczatku...
Forum PHP.pl > Forum > PHP > Frameworki
Wasper
Hej.
Kupilem ksiazke pana Gajdy apropo symfony2, sciagnalem odpalilem szkielet, uzupelnilem wszystkie braki ktore wyrzucal config i jest ok.

Nastepny krok w ksiazce

  1. Krok 2. Usuń pakiet demo
  2.  
  3. - Usuń folder hello-world/src/Acme/.
  4.  
  5.  - W pliku hello-world/app/AppKernel.php usuń wpis:
  6. $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
  7. 
  8. - W pliku hello-world/app/config/routing_dev.php usuń wpisy:
  9. _welcome:
  10. pattern: /
  11. defaults: { _controller: AcmeDemoBundle:Welcome:index }
  12.  
  13. _demo_secured:
  14. resource: "@AcmeDemoBundle/Controller/SecuredController.php"
  15. type:
  16. annotation
  17.  
  18. _demo:
  19. resource:type:
  20. prefix:
  21. "@AcmeDemoBundle/Controller/DemoController.php"
  22. annotation
  23. /demo
  24.  
  25. 
  26. - Usuń folder hello-world/web/bundles/acmedemo/.
  27.  
  28. dalej....
  29. - Krok 3.1. Utwórz nowy pakiet My/HelloworldBundle
  30.  
  31. /***
  32. Bundle name [MyHelloworldBundle]:
  33. Target directory [...\hello-world/src]:
  34. Configuration format (yml, xml, php, or annotation) [annotation]:
  35. Do you want to generate the whole directory structure [no]?
  36. Do you confirm generation [yes]?
  37. Confirm automatic update of your Kernel [yes]?
  38. Confirm automatic update of the Routing [yes]?
  39. ***/
  40.  
  41. - dostosuj kontroler
  42. * @Route("/hello-world.html")
  43. public function indexAction()
  44. return array()
  45.  
  46. - dostosuj widok
  47. <!DOCTYPE html>
  48. <html>
  49. <head>
  50. <title>Hello, world!</title<meta charset="UTF-8" />
  51. </head>
  52. <body>
  53. <h1>Hello, world!</h1>
  54. </body>
  55. </html>
  56.  


i po wpisaniu http://localhost/hello-world/web/app_dev.p...ello-world.html
powinno byc ok... a nie jest

  1. RuntimeException: The autoloader expected class "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener" to be defined in file "/home/Wasper/public_html/easyapp.localhost.com/vendor/symfony/symfony/src//Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php". The file was found but the class was not in it, the class name or namespace probably has a typo.


gdzie tkwi problem?questionmark.gif
config.php nadal pokazuje, ze wszystko ok
bylek
A zainstalowałeś paczki? Nie wiem jaką wersję opisuje książka pana Gajdy, ale jeżeli masz plik composer.json w głównym katalogu projektu, to musisz odpalić
Cytat
composer.phar install
. Jeśli jest plik deps to:
Cytat
php bin/vendors install
mlodygda
Witam, mam ten sam problem. vendor install nie działa, najwyżej dodanie jeszcze komendy --reinstall. Ale to nic nie zmienia.

Nie, pardon, po reinstallu wyskakuje taki błąd:

  1. A YAML file cannot contain tabs as indentation in C:\/xampp\/htdocs\/hello-world\/app\/config\/routing_dev.yml at line 2 (near " resource: "@MyHelloworldBundle/Controller/"").
toffiak
Cytat(mlodygda @ 6.04.2013, 15:30:33 ) *
Witam, mam ten sam problem. vendor install nie działa, najwyżej dodanie jeszcze komendy --reinstall. Ale to nic nie zmienia.

Nie, pardon, po reinstallu wyskakuje taki błąd:

  1. A YAML file cannot contain tabs as indentation in C:\/xampp\/htdocs\/hello-world\/app\/config\/routing_dev.yml at line 2 (near " resource: "@MyHelloworldBundle/Controller/"").


W plikach yaml stosuje sie spacje a nie tabulatory.
mlodygda
problem w tym, że w tamtym pliku nie widzę żadnego tabulatora.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.