You are here: Quick question regarding basic template « PHP Programming Language « IT news, forums, messages
Quick question regarding basic template

Posted by Phil Latio on 05/14/07 23:32

Below I have some code and below that a template file which I want to use to
display the message lines. I just get a blank page so are the functions
"getMessageLine1" and "getMessageLine2" returning objects and not strings?
Just wondering how I work around this.

Cheers

Phil


-------- HelloWorld3.php ----------
<?php

$newClass = new PrintMessage("Hello World", "Yet another Hello World");

include("HelloWorld03.tpl.php");

class PrintMessage
{
private $messageLine1;
private $messageLine2;

function __construct($messageLine1, $messageLine2)
{
$this->messageLine1 = $messageLine1;
$this->messageLine2 = $messageLine2;
}

function getMessageLine1()
{
return $this->messageLine1;
}

function getMessageLine2()
{
return $this->messageLine2;
}
}
?>

------ HelloWorld03.tpl.php -------
<html>
<head>
<title>This is HelloWorld03.tpl.php</title>
</head>
<body>
<?php echo $newClass->getMessageLine1; ?>
<br />
<?php echo $newClass->getMessageLine2; ?>
</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация