davykiash
davykiash

Reputation: 1804

Accessing action helpers from my models in zend

Can I access my action helpers from my models? What am avoiding is creating new models and calling the functions everytime I need some functionality.

Any tips?

Upvotes: 10

Views: 5496

Answers (4)

clinton.paquin
clinton.paquin

Reputation: 31

Nice call @Daniel V - you can obviously bootsrap them for use in controllers, but models need to be directly instantiated

Upvotes: 0

Danila Vershinin
Danila Vershinin

Reputation: 9845

What about:

Zend_Controller_Action_HelperBroker::getStaticHelper('helpername')->doStuff();

Upvotes: 18

Tofeeq
Tofeeq

Reputation: 2683

if helper not registered you can get as $helper = new Library_Helper_Helper();

Upvotes: 1

davykiash
davykiash

Reputation: 1804

After a few searches this lead me to the correct solution.

Upvotes: 0

Related Questions