src/Zicht/Bundle/UrlBundle/Twig/UrlExtension.php
public function objectUrl($object, $defaultIfNotFound = null)
    {
        try {
            $ret = $this->provider->url($object);
        } catch (UnsupportedException $e) {
            if (null === $defaultIfNotFound) {
                throw $e;
            } else {
                if (true === $defaultIfNotFound) {
                    $ret = (string)$object;
                } else {
                    $ret = $defaultIfNotFound;
                }
            }
        }
        return $ret;
    }
public function objectUrl($object, $defaultIfNotFound = null)
    {
        try {
            $ret = $this->provider->url($object);
        } catch (UnsupportedException $e) {
            if (null === $defaultIfNotFound) {
                throw $e;
            } else {
                if (true === $defaultIfNotFound) {
                    $ret = (string)$object;
                } else {
                    $ret = $defaultIfNotFound;
                }
            }
        }
        return $ret;
    }
public function objectUrl ( $ object , $ defaultIfNotFound = null ) { try { $ ret = $ this -> provider -> url ( $ object ) ; } catch ( UnsupportedException $ e ) { if ( null === $ defaultIfNotFound ) { throw $ e ; } else { if ( true === $ defaultIfNotFound ) { $ ret = ( string ) $ object ; } else { $ ret = $ defaultIfNotFound ; } } } return $ ret ; }
Returns an url based on the passed object.

@param object $object
@param mixed $defaultIfNotFound
@return string
Returns an url based on the passed object .