Development

#2086 (Remove helper dependency in sfPJSHelper to allow sfPJSHelper in view.yml)

You must first sign up to be able to contribute.

Ticket #2086 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

Remove helper dependency in sfPJSHelper to allow sfPJSHelper in view.yml

Reported by: Carl.Vondrick Assigned to: fabien
Priority: minor Milestone:
Component: sfPJSPlugin Version: 1.0.0
Keywords: Cc:
Qualification: Unreviewed

Description

Class sfPJSHelper currently depends on UrlHelper? to generate the path to the PJS. This makes it difficult to use sfPJSHelper outside of templates, such as in the view.yml file.

If line 49 of sfPJSPlugin/lib/helper/PJSHelper.php is changed from:

return url_for($url, $absolute).$query_string;

to

return sfContext::getInstance()->getController()->genUrl($url, $absolute) . $querystring;

then it is possible for view.yml's to include PJS:

editSuccess:
  javascripts: [<?php echo sfPJSHelper::pjs_path('module', 'action') ?>]

Change History

08/10/07 01:34:11 changed by Carl.Vondrick

Err... let me try this again!

The new return line should become:

return sfContext::getInstance()->getController()->genUrl($url, $absolute) . $querystring;

and then you can include in view.yml with:

javascripts: [<?php echo sfPJSHelper::pjs_path('module', 'action') ?>]

08/10/07 01:35:16 changed by Carl.Vondrick

Sorry, I need to file a bug report in "copy and paste" soon. :)

javascripts: [<?php echo sfPJSHelper::pjs_path('module/action') ?>]

10/28/07 17:51:27 changed by gordon

  • status changed from new to closed.
  • resolution set to fixed.
  • qualification set to Unreviewed.

fixed in r5726