You need to specify position in your view.yml, your view section name is
registerSuccess, not only register.

registerSuccess:
  javascripts: [jquery.js: {position: last}]

I am not sure, if this works only for stylesheets, but I think, it should be
the same for JS.

It is not common way of specifing javascripts like you did it. You can
specify layout scripts in your app/config/view.yml and they will be included
first. And then you can load your script also in registerSuccess.php with
use_javascripts or in module/config/view.yml

If you have enabled sfCommonFilter in your filters.yml there is no need to
call include_javascripts or include_stylesheets() in your layout template,
nor in your registerSuccess template, because common filter is doing this
automatically.

Symfony includes your register.js before jquery.js because your
registerSuccess view is rendered before layout.php and use_javascript only
adds your register.js to the response object and then the layout will push
into that array jquery.js scripts...

2009/3/14 dziobacz <[email protected]>

>
> I know what is wrong but I don't know how can I fix it. In my browser
> in view page I see:
> <script type="text/javascript" src="/js/register.js"></script> <- it
> should be 1 line down because I use in this file library jquery !
> <script type="text/javascript" src="/js/jquery.js"></script>
> <script type="text/javascript" src="/js/all.js"></script>
>
> My layout looks like:
> <?php use_javascript('jquery.js') ?>
> <?php use_javascript('all.js') ?>
> <?php include_javascripts() ?>
> <?php include_stylesheets() ?>
>
> Why symfony add register.js before jquery.js ??
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to