Is it possible to minifirewall html in Yii1 standard tools?

You must minifirewall static html pages can be saved in the layout database. How to do it in Yii, it is desirable standard means?
July 2nd 19 at 17:50
3 answers
July 2nd 19 at 17:52
Solution
In General stopped on the simple and banal
trim(preg_replace('/\s+/', ' ', $html))
July 2nd 19 at 17:54
If used as Smarty template engine, there is a special tag {strip}inside which html beneficiries and plus it only happens once at compile time of the template, not on each request.

As for standard, try to adapt the widget from Yii2, which is engaged in cutting out the extra probleem - Spaceless.
July 2nd 19 at 17:56
if a page generated by yii to frame behavior on this event
YII1 www.yiiframework.com/doc/api/1.1/CController#after...
removes spaces from view

the function itself can spy in the above widget
public function minify(string $content):string
{
 return trim(preg_replace('/>\s+<!--', '--><', $content));
 }

if the pages somewhere private to read regular means. processing function and record where necessary
does not work with an inline styles that are still used in mailings - Jessyca.McDermott commented on July 2nd 19 at 17:59
you need help with a regular expression for cutting blanks? - Brett.Haley commented on July 2nd 19 at 18:02
: no, I posted the answer above - the replacement of multiple spaces, and line breaks to single spaces through the regular season - Jessyca.McDermott commented on July 2nd 19 at 18:05

Find more questions by tags HTMLYii