I want to get an href
from my XML parameters file; this is my code:
$linkx = $params->get('linkx');
echo '<a href="$linkx"><p class="bottomp"> Find More </a>';
What's the correct way of doing this?
I want to get an href
from my XML parameters file; this is my code:
$linkx = $params->get('linkx');
echo '<a href="$linkx"><p class="bottomp"> Find More </a>';
What's the correct way of doing this?
Example using SimpleXML and XPath
<?php
$doc = new SimpleXMLELement( data() );
$fields = $doc->xpath('//form[@id="form2"]/field');
foreach( $fields as $f) {
printf('name=%s, type=%s, label=%s%s', $f['name'], $f['type'], $f['label'], PHP_EOL);
}
function data() {
return <<< eot
<data>
<form id="form1"></form>
<form id="form2">
<field name="linkx" type="text" label="Find More Link" description="Link to more news" />
<field name="linky" type="text" label="..." description="---" />
</form>
<form id="form3"></form>
</data>
eot;
}
prints
name=linkx, type=text, label=Find More Link
name=linky, type=text, label=...