• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 calling a php file directly from template

#1
[Hello!] everyone..

I tried to include a php on my footer template.

Following steps from:

Code:
https://xenforo.com/community/threads/provide-the-ability-to-call-a-php-file-directly-from-template.47825/
Here's what I created in library/test/footer.php

Code:
<?php

class footinc {

  public static function getHtml(){
  include '/home/web/public_html/library/test/123.php';
  }
}
And then I used this on my footer template:

Code:
<xen:callback class="footinc" method="getHtml"></xen:callback>
But it doesn't work.

It returns me:
Code:
Could not execute callback footinc::getHtml() - Not callable.
What mistake could I've done here?

Any solution would be appreciated.

Thank you :)
 
#3
For that file name class name should be called Test_Footer, not footinc
Hi mate,

I renamed the class file name from footinc.php to Footer_Inc.php, but I'm still getting same issue:
Code:
Could not execute callback Footer_Inc::getHtml() - Not callable.
 

Arty

Well-known member
#5
Actually, I've made a error in my post above. Correct class name for file library/test/footer.php is test_footer without capital letters.
 
#6
Actually, I've made a error in my post above. Correct class name for file library/test/footer.php is test_footer without capital letters.
yeah make sense for me now, I'm using test_footer class but still no luck:

Code:
Could not execute callback test_footer::getHtml() - Not callable.