Here is what I am trying to do:


class URLPreFilter extends PHPTAL_PreFilter {
public function filterDOM(PHPTAL_Dom_Element $root){
foreach($root->childNodes as $node ){
if ($node instanceof PHPTAL_Dom_Element){
$url_attribute_names = array('href', 'src');
$url = null;
foreach ($url_attribute_names as $url_attribute_name){
if ($scanned_string = $node->getAttributeNS('',$url_attribute_name)){
$url = $scanned_string;
if (!empty($url)){
if (preg_match('#/?(images|css|js|javascripts?|flash)#', $url)){
$url = '/layouts/${template-id}/'.((substr($url,0,1) ==
print "[[[ $url ]]]<br/>";
} else {

On 10/14/10 12:18, Kornel Lesiński wrote:
> On 14 Oct 2010, at 17:08, Levi Stanley wrote:
>> I am migrating over to using PreFilter and using the DOM to manipulate
>> the html document.  However, am trying to figure out the usefulness of
>> the method, filterDOM().  I have my DOM, and I am walking threw it and
>> making my changes, however, after I am finished the page still renders
>> the same, am I missing something?
> It might be the cache. Try PHTPAL->setForceReparse(true) during development.

PHPTAL mailing list

Reply via email to