Am Sonntag, den 16.05.2010, 21:45 -0700 schrieb felciano:
> Hi --
>
> I need to embed a pointer to a view-based static file directory in my
> templates, e.g. as the base path for serving up CSS files. Some
> frameworks have a url_for method that will return the absolute URL for
> a given view or endpoint (e.g.
http://flask.pocoo.org/docs/api/#useful-functions-and-classes).
> Is there a similar method in Bottle that I can use?
>
> Thx,
>
> Ramon
>
There is some very basic support for this but it is neither documented
nor matured enough to be an official feature:
>>> import bottle
>>> @bottle.route('/test/:x/:y', name='test')
... def test(x,y):
... return '%x - %y' % (x,y)
...
>>> bottle.url('test', x='a', y='b')
'/test/a/b'
--
Mit freundlichen Grüßen
Marcel Hellkamp