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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

excel vba - VBA Proxy auto-configuration for http requests -

sql server 2008 - split ssrs expression between 2 words -