[FLOW3-general] ResourceManager: ViewHelper and StorageBaseUri

Georg Ortner go at simplaweb.at
Sun Jan 10 03:20:19 CET 2010



Am 09.01.2010 19:49, schrieb Julian Kleinhans:
> Hi Sebastian,
>
> thanks for your answer, guilt was a wrong class documentation in
> F3\Fluid\ViewHelpers\Uri\ResourceViewHelper ;-)
>
> ok, but now i became a uncaught exception
> #1237823695: Argument "object" was not registered.
>
> Did I forget something?
>
>
> cheers
> julian
>
>
> Am 09.01.10 17:31, schrieb Sebastian Kurfürst:
>> Hey,
>>
>>> <img src="{f:uri.resource(object: {tutorial.resultImage})}" />
>> {f:uri.resource(object: {tutorial.resultImage})}<-- that's your version
>> {f:uri.resource(object: tutorial.resultImage)}<--- that's how it works :)
>>
>> Greets,
>> Sebastian
>
>

I can't find any mistake in the documentation of 
F3\Fluid\ViewHelpers\Uri\ResourceViewHelper. To me it looks like you are 
just misunderstanding the usage of this class. If you look at the 
documentation of ResourceViewHelper->render you won't find an argument 
called "object". This ViewHelper just renders a URI. The advantage of 
using that is that you don't have to care about any absolute path or 
relative to the webroot path, you just have to know the relative path to 
your public directory. So what you could do is something like that:

<img src="{f:uri.resource(path: tutorial.resultImage.relPath)}" />

Provided that your Image class has something like a "relPath" property 
with the relative path to your resource/public directory.






More information about the FLOW3-general mailing list