Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [ZF] Zend_Controller_Router_Route_Regex - zastosowanie 4go parametru
Forum PHP.pl > Forum > PHP > Frameworki
a79rtur
wycinek z manuala :

Cytat
Since regex patterns are not easily reversed, you will need to prepare a reverse URL if you wish to use a URL helper or even an assemble method of this class. This reversed path is represented by a string parsable by sprintf() and is defined as a fourth construct parameter:


  1. <?php
  2. $route = new Zend_Controller_Router_Route_Regex(
  3. 'archive/(d+)',
  4. array( ... ),
  5. array('year' => 1),
  6. 'archive/%s'
  7. );
  8. ?>


rozumiem ogolne zastosowanie tej klasy, ale nie bardzo wiem o co chodzi z 4tym parametrem, czy mógłby ktoś wyjaśnić na przykładzie
LBO
Zend nie radzi sobie z tworzeniem ścieżek z podanych wyrażeń regularnych (nie jest to przyjemne) - trzeba mu pomóc i tyle.

  1. <?php
  2. sprinft("archive/%s", 4); // "archive/4"
  3. ?>
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.