Sorry if this is a dumb question but im creating a filter class that watches for events and generates e-mails on those events. One of my requirements is that it add a table of data to the e-mail.
Two relateed questions.
1 – is it possible to call $this->widget('zii::widgets.grid.CGridView, array()); from a function within the filter.
2 – Is it possible to send the results of the widget to a variable to be included in the body of an e-mail?
If this isn’t possible i will start work on exporting to an Excel file that can be attached to the e-mail.
You put this wrong. Indifferently where you are, to render you need a controller.
So you have to create and instantiate a controller to be able to call the renderPartial on it. So what I would do is that I would put all the look into an EmailController and simply initialize and use the renderPartial, last parameter to return the output.
We used PHPMailer and the line looks like this:
we event’ dont have an EmailController. (the above code is called from a console app).