php - Symfony DomCrawler. Filter condition -
i have script in symfony 2:
use symfony\bundle\frameworkbundle\controller\controller; use symfony\component\domcrawler\crawler; class mycontroller extends controller { .... foreach($crawler->filter('[type="text/css"]') $content){ /* make things */ } foreach($crawler->filter('[rel="stylesheet"]') $content){ /* make things */ }
¿can $crawler->filter
accept various conditions , in 1 foreach? example:
foreach($crawler->filter('[rel="stylesheet"] or [type="text/css"]') $content){ /* make things */ }
the filter function takes using standard css selector, so:
foreach ($crawler->filter('[rel="stylesheet"],[type="text/css"]') $content) { /* make things */ }
should job.
Comments
Post a Comment