Joomla PHP include call variables in article from custom PHP -
i have install directphp , works fine, can print out current time php, know works.
my problem lies in using custom php call out variables , print out in articles.
first: custom php inside /media/custom.php
<?php // rental prices equipment $miniraeclassic_d = "$35.00"; $miniraeclassic_m = "$120.00"; $miniraeclassic_y = "$400.00"; $message = "hello world"; ?>
second: here included php file want retrieve information from. included in index.php of template.
// preparing template parameters jsntpltemplatehelper::prepare(); // template utilities $jsnutils = jsntplutils::getinstance(); ?> <?php include '/media/custom.php'; ?> <!doctype html> <!-- <?php echo $this->template . ' ' . jsntplhelper::gettemplateversion($this->template); ?> --> <html lang="<?php echo $this->language ?>" dir="<?php echo $this->direction; ?>"> <head>
third: in article added 2 codes, 1 trying retrieve $message
custom.php
, , test if php works in article (which prints out time).
<?php echo $message; ?> is: <?php echo date('y-m-d h:i:s');?>
fourth: here result, in article, not print out $message, print out date , time.
it did not print out $message in article, thing printed out is: 2014-05-28 22:21:50
i want call out multiple variable around article i.e.
<table border="0" width="100%"> <tr> <td width="32%" align="center" class="table-title"><b>daily</b></td> <td width="34%" align="center" class="table-title"><b>weekly</b></td> <td width="34%" align="center" class="table-title"><b>monthly</b></td> </tr> <tr> <td align="center" class="table-content"><?= $dayrental?></td> <td align="center" class="table-content"><?= $weekrental?></td> <td align="center" class="table-content"><?= $monthrental?></td> </tr>
try using following import custom php file:
<?php include(juri::root() . 'templates/' . $this->template . '/media/custom.php'); ?>
juri::root()
defined root of joomla installation have not defined in code.
Comments
Post a Comment