Maybe you could use a filter or the preExecute method of the actions
class?  Without knowing at which point the data becomes available
thats the best that I can suggest.  Perhaps you could create a slot in
the layout within the head portion of the template.  If it really
truly is only that one value, you could set a slot to be just the
width integer in the style definition.  Then, use the has_slot method
to implement a default value.  Once you do that you can call the
setSlot method in your action to populate the width value.  Its
probably not the most maintainable solution either, but I don't know
that there is one.  The only other thing I can think of is to use ajax
calls to update the object's contents and size.

HTH,
Casey
On Sep 18, 2:27 pm, Georg Gell <geor...@have2.com> wrote:
> Hi,
>
> thanks for the answer.
> at 1) AFAIK <style> should ony be in <head>,  and I cannot put anything
> in <head> in my template, this would have to be in layout.php, and there
> I think I cannot access $this->style from the action, or can I?
> at 2 a) b) I only want to change one value dynamically for each request,
> so this css would have to be it's own action. I would like to avoid the
> overhead to create the action and add another request from the browser
> that slows down the page load.
> at 2 c) same reason like 1, I can't put anything in <head> from the
> template.
>
> Georg
>
> Alexandru-Emil Lupu schrieb:
>
>
>
> > 1)  in your action $this->style = '<style></style>'; and then in your
> > templates echo $foo;
> > 2) alternative css for the pages you want modified.
> > a)  from module/config/view.yml add
>
> > action:
> >   stylesheets: ["/alternate_index"] # check the doc
> > b) in your template add
> > <?php use_stylesheets("/alternate_index") ?>
> > c) add it by hand in your template
>
> > I would recomend just 2a or 2b, as being most appropriate for a long
> > term maintainability.
>
> > Alecs
>
> > On Fri, Sep 18, 2009 at 11:16 PM, Georg Gell <geor...@have2.com
> > <mailto:geor...@have2.com>> wrote:
>
> >     Hi,
>
> >     how can I include some custom style information in a specific
> >     template?
> >     I would like to change the size of some divs fitting to the items
> >     in them.
> >     So i think i am looking for a way to insert something like
> >     <style>.item{width:17px}</style> into the template, where the 17px
> >     will
> >     be different for each request.
> >     I could create a helper for that, and use it in layout.php, but what
> >     information is available to this helper during the time it is used?
> >     Probably nothing from the action?
>
> >     Any ideas?
>
> >     Georg
>
> > --
> > As programmers create bigger & better idiot proof programs, so the
> > universe creates bigger & better idiots!
> > I am on web:  http://www.alecslupu.ro/
> > I am on twitter:http://twitter.com/alecslupu
> > I am on linkedIn:http://www.linkedin.com/in/alecslupu
> > Tel: (+4)0748.543.798
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to