View Single Post
  #3  
Old 07-17-2016, 07:41 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 460
 

Default Re: Adding a new page that contains a php code with variables?

Thank you for pointing me to KB examples. I tried to follow http://kb.x-cart.com/display/XDD/Working+with+viewer+classes and it goes fine if I add
Code:
protected function myVariable() { return "Hello World!"; }
to the viewer class. However, instead, if I write
Code:
protected function myVariable() { $mynewvariable="Hello World!"; return $mynewvariable; }
then the entire site gets messed up. So, I reformulate my question: would there be a way to use variables in the codes for added pages?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France