【发布时间】:2010-10-12 08:16:09
【问题描述】:
我有这个页面标题类:
class UI {
private static $title;
public static function getTitle() { return self::$title; }
public static function setTitle($value) { self::$title = $value; }
}
所以在我的首页我简单地声明:
UI::setTitle('Kiubbo.com :: Todas las Noticias, Fotos y Videos');
并且工作正常。问题是让 cmets 页面标题根据内容(链接标题)进行更改。我想和这个变量一样(它具有相同的名称,但它对于另一个函数它的 getTitle 不同):
<?php echo $article->getTitle(); ?>
在这个函数中:
function showAllComments($article_id, $param)
{
$article = Article::getById($article_id);
if(!empty($article))
{
?>
<div class="news_item">
<h2 class="news_item_title"><b><a href = "<?php echo $article->getUrl(); ?>"><?php echo $article->getTitle(); ?></a></b></h2>
</div>
如果有人能帮助我,我将不胜感激。
谢谢
【问题讨论】: