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 -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -