Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF] zmienne get
stanik_jr
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 30.03.2005
Skąd: Łódź

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


Witam,
mam taki oto url:

http://localhost/admin/lista/edycja/id/1

admin <= moduł
lista <= controller
edycja <= akcja

id <= nazwa zmiennej GET
1 <= wartosc zmiennej id

wszystko działa, tylko jak zrobić aby id było widziane jako zmienna $_GET (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

plik index.php
  1. <?php
  2. Zend::loadClass('Zend_Controller_Front');
  3. Zend::loadClass('Zend_Controller_Router_Rewrite');
  4.  
  5. $router = new Zend_Controller_Router_Rewrite();
  6. $controller = Zend_Controller_Front::getInstance();
  7. $controller->throwExceptions(true);
  8. $controller ->setControllerDirectory(array(
  9. 'default'=>realpath('../app/controllers/'),
  10. 'admin'=>realpath('../app/admin/controllers/')))
  11. ->setRouter($router)
  12. ->dispatch();
  13. ?>


Jakieś sugestie?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Sabistik
post
Post #2


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

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


Dostęp do parametrów masz poprzez:
  1. <?php
  2. Zend_Controller_Request::getParam();
  3. // lub
  4. Zend_Controller_Action::getParam();
  5. ?>
Go to the top of the page
+Quote Post
stanik_jr
post
Post #3





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 30.03.2005
Skąd: Łódź

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


Dzięki uzyłem tego:
  1. <?php
  2. Zend_Controller_Action::_getAllParams();
  3. // lub
  4. Zend_Controller_Action::_getParam();
  5. ?>

ale to chyba to samo (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował stanik_jr 6.03.2007, 22:40:47
Go to the top of the page
+Quote Post

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: 22.08.2025 - 18:43