вторник, 18 июня 2013 г.

Create Full URLs in ZF2 Views

Нашел интересный блог по zf2. Информация по созданию url

http://codingexplained.com/coding/php/zend-framework/create-full-urls-in-zf2-views

// Using a route with the name "register" and the route "/register"
echo $this->url('register', array(), array('force_canonical' => true));  
// Output: http://mydomain.com/register

echo $this->serverUrl(); // Output: http://mydomain.com


// Current URL: http://mydomain.com/register
echo $this->serverUrl(true); // Output: http://mydomain.com/register



// The "register" route has the following route: /register
echo $this->serverUrl($this->url('register'));  
// Output: http://mydomain.com/register

Комментариев нет:

Отправить комментарий