A
A
AntonGoretskiy2014-10-06 16:01:56
Zend Framework
AntonGoretskiy, 2014-10-06 16:01:56

Zf2 where is it more correct to define helper?

Hello,
there are a couple of controllers from which you need to send almost identical letters. I want to declare somewhere a class that will create and send these letters. Where is the best place and how to do it? Create a Helpers folder where Controllers and Models are?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Grechushnikov, 2014-10-06
@AntonGoretskiy

Yes

S
Sergey, 2014-10-06
Protko @Fesor

there are a couple of controllers from which you need to send almost identical letters

This should not be in controllers. This is what services are for.
Controllers should be as dumb as possible, their task is to work with input / output. That is, we take the request, understand what needs to be done and tell it to the services. Those do, give the result to the controller, which returns it to the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question