rellek
Well-known member
Let's just assume you want to clear the template 'header' with "XenForo rocks" using a PHP callback in a template modification... I think this doesn't work.
Here's what I entered:
Template: header
Modification Key: removeheader
Description: test
Search Type: PHP Callback
Find: /.+/is
Replace: rellek_TMSTest::myMethod
and there's a file, ./library/rellek/TMSTest.php which looks like this:
This won't work.
It doesn't match anything when I click "Test Modification" and has the status 0/0/1 in the TM list.
If I change PHP callback to Regular Expression, It shows me that it matches everything and replaces this with my callback name.
Question is, is this a bug or am I doing something wrong?
Here's what I entered:
Template: header
Modification Key: removeheader
Description: test
Search Type: PHP Callback
Find: /.+/is
Replace: rellek_TMSTest::myMethod
and there's a file, ./library/rellek/TMSTest.php which looks like this:
PHP:
<?php
class rellek_TMSTest {
public function myMethod(array $args) {
return 'XenForo rocks';
}
}
This won't work.
It doesn't match anything when I click "Test Modification" and has the status 0/0/1 in the TM list.
If I change PHP callback to Regular Expression, It shows me that it matches everything and replaces this with my callback name.
Question is, is this a bug or am I doing something wrong?