Robin S Posted November 8, 2016 Share Posted November 8, 2016 Is it possible to use a selector to find fields that have a given textformatter applied? I tried... $flds = $fields->find("textformatters=TextformatterHannaCode"); ...but the textformatters property is an array so I get an array to string conversion error. So a broader question would be: is it possible to use a selector to match inside a property that is an array? For the textformatter, is there a more efficient way than just iterating over $fields? $flds = []; foreach($fields as $field) { if( is_array($field->textformatters) && in_array('TextformatterHannaCode', $field->textformatters) ) $flds[] = $field; } 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now