you can use it in  JavascriptHelper.php : javascript_tag(' ');

<?php echo javascript_tag('
  var url = " '.url_for('module/action').' ";
');?>
I used it in my jQueryHelper called jq_javascript_tag(''); looks like
JavascriptHelper javascript_tag();
My English not good,I hope you can read these words

On 4月16日, 下午7时08分, Ahmed <[email protected]> wrote:
> Hi all :) ,
> I want to use a php function to generate url ( for ajax call) in a js
> file like this :
>
> <?php Header("content-type: application/x-javascript"); ?>
> $(document).ready(function(){
>         $.ajax({
>           url: "<?php echo url_for('company/step1')?>",
>           success: function(html){
>             $("#step1_container").append(html);
>           }
>         });
>
> }) ;
>
> But in the generated code i have a logic error
> $(document).ready(function(){
> 2 $.ajax({
> 3 url: "<br />
> 4<b>Fatal error</b>: Call to undefined function url_for() in <b>....
> \www\web\js\company\home.js.php</b> on line <b>4</b><br />
>
> How can i resolve this please ?
>
> [Updated on: Thu, 16 April 2009 12:39]
--~--~---------~--~----~------------~-------~--~----~
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