On 1 Aug 2009, at 22:10, Michal Charemza wrote:
> I'm not sure if this is really bad, but it seems to work so far...


I found an issue where if the generated route is the actual basePath,  
then the generated path disappears to nothing. The following fixes  
that by replacing the empty string with "./" for that case.

public function gen($route, array $params = array(), $options = array())
{
        $generatedRoute = parent::gen($route, $params, $options);

        $trimBase = !isset($options['relative']) ||  
(isset($options['relative']) && $options['relative'] == false);
        $trimBase = $trimBase && (strpos($generatedRoute, $this->basePath)  
=== 0);
        $generatedRoute = ($trimBase) ? substr($generatedRoute, strlen($this- 
 >basePath)) : $generatedRoute;
        $generatedRoute = ($trimBase && $generatedRoute == "") ? "./" :  
$generatedRoute;

        return $generatedRoute;
}

If this is really bad for some reason, I would be grateful to know!

Michal.

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to