I’m looking at a PHP logic problem for me, but I can’t fix it, so I ask you guys here. How can I call/combine the underneath PHP img with the var string method?
I would like to call an image with PHP:
<img src="<?php echo $this->getSkinUrl('images/prev.gif'); ?>
But I would like to call the php from the following string:
var str_buffer = new String (
"<table width=\"100%\">\n"+
"<tr>\n <td>\n"+
"<img src=\"prev.gif\" width=\"16\" height=\"16\" border=\"0\""+
" alt=\"previous month\"></td>\n"+
"</tr>\n</table>\n"
);
If I understand correctly you want to implement the method used in the PHP for calling a function, within the Javascript code?
If so, You need to enclose the Javascript segments within a PHP output statement.
Eg.
Aditionally, you will need to implement the class/object on the page where you want to use it.