Development

#4859 (Url helper dependency)

You must first sign up to be able to contribute.

Ticket #4859 (closed defect: wontfix)

Opened 8 months ago

Last modified 8 months ago

Url helper dependency

Reported by: Tomek Assigned to: fabien
Priority: minor Milestone:
Component: helpers Version: 1.2.0 DEV
Keywords: dependency helper url Cc:
Qualification: Unreviewed

Description

I want to use Url helper in my action, so I use sfLoader::loadHelpers(array('Url'));

However, if I just include the 'Url', link_to function will not work. It looks like it depends on the function in 'Tag' helper, so it can be easily fixed by: sfLoader::loadHelpers(array('Tag','Url'));

It's not really a big problem, but maybe 'Url' helper should include 'Tag' automatically, since it depends on it? Or maybe function: _parse_attributes() (that's the missing function that 'Url' is using) should be extracted to the common library, or duplicated in 'Url'?

I'm using latest symfony1.2 from SVN, revision: 12718.

cheers, Tomek

Change History

11/07/08 19:03:57 changed by Tomek

I have just noticed the warning: The sfLoader::loadHelpers() method is deprecated. Please use the same method from sfApplicationConfiguration.

So I understand that instead of sfLoader I should have used:

$this->context->getConfiguration()->loadHelpers(array('Tag','Url'));

Except for this change, my original issue is still the same ("Url" helper depends on "Tag").

11/17/08 23:44:19 changed by fabien

  • status changed from new to closed.
  • resolution set to wontfix.
  • milestone deleted.

The helpers are to be used in templates where Tag is loaded for you. If you need them in the action, which I think is not a good idea, you will have to take care of the dependency for yourself.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.