Managing asset in ZF2

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Managing asset in ZF2

Andy L.
Hi everyone,

How do you manage asset / static files in ZF2? I don't see it in manuals /
docs.

- Say i have 3 modules, each has its own asset (static file : css, js), how
do you load your css in view script?

- Do you symlink your assets to public directory? Do you symlink manually
or do you use a tool?

- I'd like to have an asset management module, that I can configure the
base url so I can serve my asset via other base url, eg via CDN. Does
anyone has any recommendations?





--
Warmest regards,

Andy L.
Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

Enrico Zimuel-2
Hi Andy,

you can use this AssetManager module:
https://github.com/RWOverdijk/AssetManager
It should cover all your needs.

Here you can find also a blog post that shows how to use it:
http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/

Regards,
Enrico Zimuel

On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]> wrote:

> Hi everyone,
>
> How do you manage asset / static files in ZF2? I don't see it in manuals /
> docs.
>
> - Say i have 3 modules, each has its own asset (static file : css, js), how
> do you load your css in view script?
>
> - Do you symlink your assets to public directory? Do you symlink manually
> or do you use a tool?
>
> - I'd like to have an asset management module, that I can configure the
> base url so I can serve my asset via other base url, eg via CDN. Does
> anyone has any recommendations?
>
>
>
>
>
> --
> Warmest regards,
>
> Andy L.

--
Enrico Zimuel
Senior PHP Engineer     | [hidden email]
Zend Framework Team     | http://framework.zend.com
Zend Technologies Ltd.
http://www.zend.com

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

settermjd
Thanks for the link. I was looking for something just like this.

Kind regards,

Matt
http://www.maltblue.com
Web application with professionals you trust

Sent whilst on the move

Am 20 Jul 2013 um 12:16 schrieb Enrico Zimuel <[hidden email]>:

> Hi Andy,
>
> you can use this AssetManager module:
> https://github.com/RWOverdijk/AssetManager
> It should cover all your needs.
>
> Here you can find also a blog post that shows how to use it:
> http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/
>
> Regards,
> Enrico Zimuel
>
> On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]> wrote:
>> Hi everyone,
>>
>> How do you manage asset / static files in ZF2? I don't see it in manuals /
>> docs.
>>
>> - Say i have 3 modules, each has its own asset (static file : css, js), how
>> do you load your css in view script?
>>
>> - Do you symlink your assets to public directory? Do you symlink manually
>> or do you use a tool?
>>
>> - I'd like to have an asset management module, that I can configure the
>> base url so I can serve my asset via other base url, eg via CDN. Does
>> anyone has any recommendations?
>>
>>
>>
>>
>>
>> --
>> Warmest regards,
>>
>> Andy L.
>
> --
> Enrico Zimuel
> Senior PHP Engineer     | [hidden email]
> Zend Framework Team     | http://framework.zend.com
> Zend Technologies Ltd.
> http://www.zend.com
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

Andy L.
In reply to this post by Enrico Zimuel-2
Hi Enrico,

Thanks for the link, I am taking a look at it. It seems good & useful.

But now these questions come to my mind. The module caches assets,
loads, and sends them as an mvc response. Is this kind of approach good for
production & scalability? Is there a way to just dump the assets to a
directory, and serve them as a regular static files (without the need
of php) ?



On Saturday, July 20, 2013, Enrico Zimuel wrote:

> Hi Andy,
>
> you can use this AssetManager module:
> https://github.com/RWOverdijk/AssetManager
> It should cover all your needs.
>
> Here you can find also a blog post that shows how to use it:
> http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/
>
> Regards,
> Enrico Zimuel
>
> On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]<javascript:;>>
> wrote:
> > Hi everyone,
> >
> > How do you manage asset / static files in ZF2? I don't see it in manuals
> /
> > docs.
> >
> > - Say i have 3 modules, each has its own asset (static file : css, js),
> how
> > do you load your css in view script?
> >
> > - Do you symlink your assets to public directory? Do you symlink manually
> > or do you use a tool?
> >
> > - I'd like to have an asset management module, that I can configure the
> > base url so I can serve my asset via other base url, eg via CDN. Does
> > anyone has any recommendations?
> >
> >
> >
> >
> >
> > --
> > Warmest regards,
> >
> > Andy L.
>
> --
> Enrico Zimuel
> Senior PHP Engineer     | [hidden email] <javascript:;>
> Zend Framework Team     | http://framework.zend.com
> Zend Technologies Ltd.
> http://www.zend.com
>


--
Warmest regards,

Andy L.
Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

Bas Kamer
Look into one of the caching options. That copies static assets to the public dir - turning them into regular requests (bypassing mvc)

Op 20 jul. 2013 om 17:40 heeft "Andy L." <[hidden email]> het volgende geschreven:

> Hi Enrico,
>
> Thanks for the link, I am taking a look at it. It seems good & useful.
>
> But now these questions come to my mind. The module caches assets,
> loads, and sends them as an mvc response. Is this kind of approach good for
> production & scalability? Is there a way to just dump the assets to a
> directory, and serve them as a regular static files (without the need
> of php) ?
>
>
>
> On Saturday, July 20, 2013, Enrico Zimuel wrote:
>
>> Hi Andy,
>>
>> you can use this AssetManager module:
>> https://github.com/RWOverdijk/AssetManager
>> It should cover all your needs.
>>
>> Here you can find also a blog post that shows how to use it:
>> http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/
>>
>> Regards,
>> Enrico Zimuel
>>
>> On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]<javascript:;>>
>> wrote:
>>> Hi everyone,
>>>
>>> How do you manage asset / static files in ZF2? I don't see it in manuals
>> /
>>> docs.
>>>
>>> - Say i have 3 modules, each has its own asset (static file : css, js),
>> how
>>> do you load your css in view script?
>>>
>>> - Do you symlink your assets to public directory? Do you symlink manually
>>> or do you use a tool?
>>>
>>> - I'd like to have an asset management module, that I can configure the
>>> base url so I can serve my asset via other base url, eg via CDN. Does
>>> anyone has any recommendations?
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Warmest regards,
>>>
>>> Andy L.
>>
>> --
>> Enrico Zimuel
>> Senior PHP Engineer     | [hidden email] <javascript:;>
>> Zend Framework Team     | http://framework.zend.com
>> Zend Technologies Ltd.
>> http://www.zend.com
>
>
> --
> Warmest regards,
>
> Andy L.

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

Marco Pivetta
In reply to this post by Andy L.
@Andy there's another module called BaconAssetLoader (
https://github.com/Bacon/BaconAssetLoader ) which basically deploys your
assets into the `public/` directory.

The one I and RWOverdijk developed uses a different approach because we
basically need to see changed assets as soon as it happens (if no file
caching strategy is set).



Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 20 July 2013 17:40, Andy L. <[hidden email]> wrote:

> Hi Enrico,
>
> Thanks for the link, I am taking a look at it. It seems good & useful.
>
> But now these questions come to my mind. The module caches assets,
> loads, and sends them as an mvc response. Is this kind of approach good for
> production & scalability? Is there a way to just dump the assets to a
> directory, and serve them as a regular static files (without the need
> of php) ?
>
>
>
> On Saturday, July 20, 2013, Enrico Zimuel wrote:
>
> > Hi Andy,
> >
> > you can use this AssetManager module:
> > https://github.com/RWOverdijk/AssetManager
> > It should cover all your needs.
> >
> > Here you can find also a blog post that shows how to use it:
> > http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/
> >
> > Regards,
> > Enrico Zimuel
> >
> > On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]
> <javascript:;>>
> > wrote:
> > > Hi everyone,
> > >
> > > How do you manage asset / static files in ZF2? I don't see it in
> manuals
> > /
> > > docs.
> > >
> > > - Say i have 3 modules, each has its own asset (static file : css, js),
> > how
> > > do you load your css in view script?
> > >
> > > - Do you symlink your assets to public directory? Do you symlink
> manually
> > > or do you use a tool?
> > >
> > > - I'd like to have an asset management module, that I can configure the
> > > base url so I can serve my asset via other base url, eg via CDN. Does
> > > anyone has any recommendations?
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Warmest regards,
> > >
> > > Andy L.
> >
> > --
> > Enrico Zimuel
> > Senior PHP Engineer     | [hidden email] <javascript:;>
> > Zend Framework Team     | http://framework.zend.com
> > Zend Technologies Ltd.
> > http://www.zend.com
> >
>
>
> --
> Warmest regards,
>
> Andy L.
>
Reply | Threaded
Open this post in threaded view
|

Re: Managing asset in ZF2

Andy L.
@Marco Pivetta & everyone

Thanks for your help :)

I will try both to see which one is suitable for my need.


On Sunday, July 21, 2013, Marco Pivetta wrote:

> @Andy there's another module called BaconAssetLoader (
> https://github.com/Bacon/BaconAssetLoader ) which basically deploys your
> assets into the `public/` directory.
>
> The one I and RWOverdijk developed uses a different approach because we
> basically need to see changed assets as soon as it happens (if no file
> caching strategy is set).
>
>
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
>
> On 20 July 2013 17:40, Andy L. <[hidden email] <javascript:_e({},
> 'cvml', '[hidden email]');>> wrote:
>
>> Hi Enrico,
>>
>> Thanks for the link, I am taking a look at it. It seems good & useful.
>>
>> But now these questions come to my mind. The module caches assets,
>> loads, and sends them as an mvc response. Is this kind of approach good
>> for
>> production & scalability? Is there a way to just dump the assets to a
>> directory, and serve them as a regular static files (without the need
>> of php) ?
>>
>>
>>
>> On Saturday, July 20, 2013, Enrico Zimuel wrote:
>>
>> > Hi Andy,
>> >
>> > you can use this AssetManager module:
>> > https://github.com/RWOverdijk/AssetManager
>> > It should cover all your needs.
>> >
>> > Here you can find also a blog post that shows how to use it:
>> > http://ocramius.github.io/blog/asset-manager-for-zend-framework-2/
>> >
>> > Regards,
>> > Enrico Zimuel
>> >
>> > On Sat, Jul 20, 2013 at 9:29 AM, Andy L. <[hidden email]<javascript:_e({}, 'cvml', '[hidden email]');>
>> <javascript:;>>
>> > wrote:
>> > > Hi everyone,
>> > >
>> > > How do you manage asset / static files in ZF2? I don't see it in
>> manuals
>> > /
>> > > docs.
>> > >
>> > > - Say i have 3 modules, each has its own asset (static file : css,
>> js),
>> > how
>> > > do you load your css in view script?
>> > >
>> > > - Do you symlink your assets to public directory? Do you symlink
>> manually
>> > > or do you use a tool?
>> > >
>> > > - I'd like to have an asset management module, that I can configure
>> the
>> > > base url so I can serve my asset via other base url, eg via CDN. Does
>> > > anyone has any recommendations?
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > Warmest regards,
>> > >
>> > > Andy L.
>> >
>> > --
>> > Enrico Zimuel
>> > Senior PHP Engineer     | [hidden email] <javascript:_e({}, 'cvml',
>> '[hidden email]');> <javascript:;>
>> > Zend Framework Team     | http://framework.zend.com
>> > Zend Technologies Ltd.
>> > http://www.zend.com
>> >
>>
>>
>> --
>> Warmest regards,
>>
>> Andy L.
>>
>
>

--
Warmest regards,

Andy L.