Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony]Plik routing.yml oraz sfGuardAuth
logas
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 1
Dołączył: 15.03.2008

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


Witam mam pewien problem tak więc ustawiłam wartość is_secure: na "on" w pliku seriurity.yml i gdy wchodzie pod adres http://localhost/page_dev.php/ wyświetla się folmularz podaje hasło i login i wyrzuca mi błąd
Kod
Action "login/index" does not exist.
Wiem ,że błąd spowodowany jest przez plik routing.yml oto jego zawartość
Kod
# default rules
homepage:
   url: /
   param: { module: default, action: index }
default_symfony:
   url: /symfony/:action/*
   param: { module: default }

default_index:
   url:   /:module
   param: { action: index }

default:
   url:   /:module/:action/*

sf_guard_signin:
    url:  /login
    param: { module: sfGuardAuth, action: signin }

sf_guard_signout:
    url:  /logout
    param: { module: sfGuardAuth, action: signout }

sf_guard_password:
     url:  /request_password
     param: { module: sfGuardAuth, action: password }
chodzi o ten kod
Kod
default_index:
    url:   /:module
    param: { action: index }

zapewne on traktuje /login w adresie jako moduł i automatyczne dopisuje sobie to co trzeba.Ale gdy usune ten kod z pliku routing.yml musze potem ręcznie dopisywać do adresu "index" n.p http://localhost/page_dev.php/user/index bo gdy tego nie zrobie wyrzuca błąd i teraz pytanie jak to zrobić ,żeby po wpisuaniu w adresie /login plik routing.yml nie traktował go jako moduł i jeszcze jedno pytanie co oznacza
Kod
sf_guard_signout:,sf_guard_password:,sf_guard_password:
z góry dziękuje za odpowiedzi.

Problem roziwiązany wystarczyło tak edytować plik routing.yml
Kod
# default rules
sf_guard_signin:
   url:  /login
   param: { module: sfGuardAuth, action: signin }

sf_guard_signout:
   url:  /logout
   param: { module: sfGuardAuth, action: signout }

sf_guard_password:
    url:  /request_password
    param: { module: sfGuardAuth, action: password }


homepage:
  url: /
  param: { module: default, action: index }

default_symfony:
  url: /symfony/:action/*
  param: { module: default }

default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*

Ale nadal nie wiem do czego są potrzebne te znaczniki
Kod
sf_guard_signout:,sf_guard_password:,sf_guard_password:


Ten post edytował logas 22.08.2008, 16:29:24
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
-=Peter=-
post
Post #2





Grupa: Zarejestrowani
Postów: 304
Pomógł: 51
Dołączył: 4.02.2005
Skąd: Kraków

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


Masz złą kolejność regułek, odwróć plik route.yml "do góry nogami" tongue.gif gdyż ten plik jest parsowany od góry, a nie od dołu...

Edit:
co do drugiego pytania, to może byś przeczytał rozdział o routingu w oficjalnym manualu symfony klik, tam to jest wyjaśnione.

Po to to jest abyś mógł tworzyć w taki sposób link:
  1. <?php
  2. link_to('blebleble', '@sf_guard_signout');
  3. ?>

Jest to lepsze i bardziej elastyczne z kilku względów (wydajniejsze, gdy zmieniasz parametry tej regułki nie musisz edytować widoku itp).

Ten post edytował -=Peter=- 22.08.2008, 16:59:39


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 05:30