Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZF] zmienne get
stanik_jr
post 6.03.2007, 14:18:55
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 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
Sabistik
post 6.03.2007, 21:01:13
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 6.03.2007, 22:40:15
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 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
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 17:17