Suggesting Removal of Asset

4 views
Skip to first unread message

Chris Boden

unread,
Apr 1, 2011, 10:50:19 AM4/1/11
to Alloy
I feel the Asset class does not add any value and could stand to be
removed.

To achieve the same functionality without convoluting HTML markup
within PHP calls you could add a base tag in the /app/layouts/
app.html.php file:

<base href="<?php echo $kernel->config('url.root'); ?>">
<link type="text/css" rel="stylesheet" href="assts/styles/app.css">

Thoughts?

Vance Lucas

unread,
Apr 1, 2011, 10:57:21 AM4/1/11
to allo...@googlegroups.com
You could certainly go that way, but I personally use it all the time and like it. I don't see it as bloat, and therefore don't see any reason for it to be removed, but to each his own, I guess. :)

The main benefit is when you need to add stylesheets or scripts programmatically with dynamic variables outside the actual layout HTML markup. A good example is a CMS I am building that adds markup, scripts, and styles to the page if you are logged in with edit rights using the Head helper's append/prepend methods. This is also a good way for plugins and modules to add asset dependencies dynamically at runtime.

--
Vance Lucas
http://vancelucas.com

Chris Boden

unread,
Apr 1, 2011, 10:59:43 AM4/1/11
to Alloy
Good point. I was being too short sighted.

What about adding a goto? (kidding, apr1)

On Apr 1, 10:57 am, Vance Lucas <va...@vancelucas.com> wrote:
> You could certainly go that way, but I personally use it all the time and
> like it. I don't see it as bloat, and therefore don't see any reason for it
> to be removed, but to each his own, I guess. :)
>
> The main benefit is when you need to add stylesheets or scripts
> programmatically with dynamic variables outside the actual layout HTML
> markup. A good example is a CMS I am building that adds markup, scripts, and
> styles to the page if you are logged in with edit rights using the Head
> helper's append/prepend methods. This is also a good way for plugins and
> modules to add asset dependencies dynamically at runtime.
>
> --
> Vance Lucashttp://vancelucas.com
Reply all
Reply to author
Forward
0 new messages