@
@
@deffect2016-08-12 14:03:40
JavaScript
@deffect, 2016-08-12 14:03:40

ZF2. How to set View in ViewHelper when using app via console?

There is a task to send email via console. Part of the content of the letter - statistics - is formed through the ViewHelper "accountsStat". The ViewHelper "accountsStat" itself also uses other ViewHelpers (eg "decodeUrl").
As I understand it, the problem is that when the application is launched via the console, ZF2 does not initialize the View, as it does when launched via http.
So inside the ViewHelper "accountsStat" is an empty $this->getView().
Of course, when working with the console, you can initialize the View for each ViewHelper.
But as I already wrote, in the accountsStat.phtml itself, other ViewHelpers are used, which also need to be hooked to the View on their own...
I would like to know if this problem can be solved in a complex way: i.e. configure based on the "view_manager" file "module.config.php" View (+ taking into account \Application\Module->getViewHelperConfig()) for all ViewHelpers, as it would be for http?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VZVZ, 2016-04-24
@VZVZ

> var content = document.querySelectorAll('.content');
Of course it will happen to everyone. All same.
It is necessary to use this (or something else) inside onclick to access only a specific element ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question