Skip to content

Instantly share code, notes, and snippets.

@speedmax
Created January 25, 2009 01:04
Show Gist options
  • Save speedmax/51619 to your computer and use it in GitHub Desktop.
Save speedmax/51619 to your computer and use it in GitHub Desktop.
{{ 'post_view' | zend_url postid: post.id }}
// url for post_view route
{{ 'Martel' | links_to_route 'user' username: 'martel' }}
// links_to_route helper filter
// outputs <a href="<?= $this->url(array('username' => 'martel'), 'user') ?>">Martel</a>
<?php
class ZendUrlFilters extends HtmlFilters{
# static instance of Zend View
static $View;
function zend_url($route, $options) {
return self::$View->url($route, $options);
}
function links_to_route($title, $route, $options) {
$url = self::zend_url($route, $options);
return self::links_to($title, $url, $options);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment