Listing 23.19. Treść pliku angaze/lib/myFilter.class.php
<?php
class stripFilter extends sfFilter
{
    public function execute($filterChain)
    {
        $filterChain->execute();
        $response = $this->getContext()->getResponse();
        $org = $response->getContent();
        $re = '/(\s*<!--strip-->(.*?)<!--\/strip-->\s*)/ims';
        while (preg_match($re, $org, $m)) {
            $ze_spacjami = $m[2];
            $bez_spacji = trim(preg_replace('/\r?\n\s*/', '', $ze_spacjami));
            $org = str_replace($m[1], $bez_spacji, $org);
        }
        $response->setContent($org);
    }
}