Codium
Codium

Reputation: 3240

How to add helper to view helpers?

As in title: How to add helper to view helpers? so I can use it without loading custom helpers group?

Upvotes: 2

Views: 1497

Answers (2)

Stef
Stef

Reputation: 213

You can use the settings.yml to auto load helpers. Don't forget to add the default ones (Partial, Cache) too or they won't be loaded.

For example:

all:
  .settings:
    standard_helpers: [Partial, Cache, MyCustomHelper]

http://www.symfonyreference.com/ is a good site for symfony configuration reference.

Upvotes: 3

Maxime Pacary
Maxime Pacary

Reputation: 23031

Quoting the "gentle introduction" to Symfony 1.4

The list of the standard helpers, loaded by default for every template, is configurable in the settings.yml file.

It will avoid to call use_helper() on all of your templates (if I have correctly understood your question).

Upvotes: 2

Related Questions