本文整理匯總了PHP中Brick::ReplaceVar方法的典型用法代碼示例。如果您正苦於以下問題:PHP Brick::ReplaceVar方法的具體用法?PHP Brick::ReplaceVar怎麽用?PHP Brick::ReplaceVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Brick
的用法示例。
在下文中一共展示了Brick::ReplaceVar方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
<?php
/**
* @package Abricos
* @subpackage News
* @copyright Copyright (C) 2010 Abricos All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @author Alexander Kuzmin (roosit@abricos.org)
*/
$brick = Brick::$builder->brick;
$param = $brick->param;
Abricos::GetModule('news')->GetManager();
$manager = NewsManager::$instance;
$newsid = intval(Abricos::$adress->dir[1]);
$row = $manager->News($newsid, true);
if (empty($row)) {
$brick->content = $brick->param->var['notfound'];
return;
}
$var =& $brick->param->var;
$var['title'] = Brick::ReplaceVar($var['title'], "val", $row['tl']);
$var['date'] = Brick::ReplaceVar($var['date'], "val", $row['dp'] > 0 ? rusDateTime(date($row['dp'])) : $brick->param->var['notpub']);
$var['intro'] = Brick::ReplaceVar($var['intro'], "val", $row['intro']);
$var['body'] = Brick::ReplaceVar($var['body'], "val", $row['body']);
$var['source'] = '';
$var['image'] = '';
if (!empty($row['tl'])) {
Brick::$builder->SetGlobalVar('meta_title', $row['tl']);
}
Brick::$contentId = $row['ctid'];