researcher
Member
Hey!
I am trying to insert my own PHP codes on a custom page. I am adding the callbacks but it never works... Its what I did:
1) Created a directory as named TestCallbacks and put an index.php inside this directory.
(Full path: /var/www/vhosts/example.com/httpdocs/library/TestCallbacks/index.php)
2) index.php codes:
3) When I am trying to write the class name as TestCallbacks_index:getHtml I got error:
Also, I have tried
My XF version is: 2.1.4 , how can I solve this problem?
Thanks.
I am trying to insert my own PHP codes on a custom page. I am adding the callbacks but it never works... Its what I did:
1) Created a directory as named TestCallbacks and put an index.php inside this directory.
(Full path: /var/www/vhosts/example.com/httpdocs/library/TestCallbacks/index.php)
2) index.php codes:
PHP:
<?php
class TestCallbacks_index {
public static function getHtml(){
echo 'hello';
// tried return 'hello'; too and not worked
}
}
3) When I am trying to write the class name as TestCallbacks_index:getHtml I got error:
Also, I have tried
<xen:callback class="TestCallbacks" method="getHtml"></xen:callback>
code but it did not worked too, I got empty page or error_invalid_class error.My XF version is: 2.1.4 , how can I solve this problem?
Thanks.