|
valuesToSelectorAttrMethodPHP
valuesToSelectorAttrWiki > Syntax > valuesTo > valuesToSelectorAttr Parameters
Target attribute name. Associative array or Object containing markup, text or instance of Callback. Defines pattern matching target nodes. %k represents key. Defaults to ".%k", which matches nodes with class name equivalent to data source key. For example, to restrict match to nodes with additional class "foo" change $selectorPattern to ".foo.%k" Array of fields from $values which should be skipped. Callback triggered after every insertion. Three parameters are passed to this callback: DescriptionInjects markup from $values' content (rows or attributes) as attribute of nodes matched by selector. Method uses actually matched nodes as root for the query. Method doesn't change selected elements stack. ExampleMarkup<p class='field1'>lorem ipsum</p> <p class='field2'>lorem ipsum</p> Data$values = array( 'field1' => '<foo/>', 'field2' => '<bar/>' ); QueryTemplates formula $template->
valuesToSelectorAttr('rel', $values)
;
Template<p class="field1" rel="<foo/>">lorem ipsum</p> <p class="field2" rel="<bar/>">lorem ipsum</p> Template tree beforep.field1 - Text:lorem ipsum p.field2 - Text:lorem ipsum Template tree afterp.field1 - Text:lorem ipsum p.field2 - Text:lorem ipsum See alsoComments allowed |
Sign in to add a comment