当前位置: 首页>>代码示例>>PHP>>正文


PHP Brick::ReplaceVarByData方法代码示例

本文整理汇总了PHP中Brick::ReplaceVarByData方法的典型用法代码示例。如果您正苦于以下问题:PHP Brick::ReplaceVarByData方法的具体用法?PHP Brick::ReplaceVarByData怎么用?PHP Brick::ReplaceVarByData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Brick的用法示例。


在下文中一共展示了Brick::ReplaceVarByData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: while

<?php

/**
 * Список последних новостей
 *
 * @version $Id$
 * @package Abricos
 * @subpackage News
 * @copyright Copyright (C) 2008 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;
$mod = Abricos::GetModule('news');
$manager = $mod->GetManager();
$limit = $brick->param->param['count'];
$hideintro = $brick->param->param['hideintro'];
if (empty($hideintro) && !empty($brick->parent) && isset($brick->parent->param->param['hideintro'])) {
    $hideintro = $brick->parent->param->param['hideintro'];
}
$dateFormat = $mod->GetPhrases()->Get('date_format', "Y-m-d");
$baseUrl = "/" . $mod->takelink . "/";
$lst = "";
$rows = $manager->NewsList(1, $limit);
$viewcount = 0;
while ($row = Abricos::$db->fetch_array($rows)) {
    $viewcount++;
    $lst .= Brick::ReplaceVarByData($brick->param->var['row'], array("date" => date($dateFormat, $row['dp']), "link" => $baseUrl . $row['id'] . "/", "title" => $row['tl'], "intro" => !empty($hideintro) ? '' : $row['intro']));
}
$brick->viewcount = $viewcount;
$brick->param->var['result'] = $lst;
开发者ID:rucos,项目名称:abricos-mod-news,代码行数:31,代码来源:brick_lastnews.php

示例2: date

    $sheetId = "_____";
}
$rowsmark .= $rowEnd;
$countSemestr = $sheet['nc'] * 2 + ($sheet['sem'] - 2);
$yearEnd = $sheet['dad'] + $sheet['nc'];
$dtSheet = $sheet['date'] ? date('d.m.Y', $sheet['date']) : "";
$formCtrl = $sheet['fct'];
$form = "Форма контроля -";
$act = "проведения";
if ($type > 2) {
    $proj = explode(',', $sheet['pj']);
    if ($proj[0] == 1) {
        $formCtrl = "Курсовая работа";
    } elseif ($proj[1] == 1) {
        $formCtrl = "Курсовой проект";
    }
    $volume = "";
} else {
    $hours = explode('/', $sheet['nh']);
    if ($formCtrl === 'Практика') {
        $formCtrl = "";
        $form = "";
        $act = "сдачи";
        $volume = "Даты " . $hours[0] . "." . $yearEnd . " г. - " . $hours[1] . "." . $yearEnd . " г.";
    } else {
        $vhours = $hours[0] + $hours[1];
        $volume = "Объем " . $vhours . " (" . $hours[0] . "/" . $hours[1] . ")" . " часов " . "(" . $vhours / 36 . " зач. ед.)";
    }
}
$brick->content = Brick::ReplaceVarByData($brick->content, array("fullname" => $fullname, "shortname" => $shortname, "extra" => $extra, "idSheet" => $sheetId, "numGroup" => $sheet['ng'], "countSemestr" => $countSemestr, "nameSubject" => $sheet['ns'], "field" => $sheet['fc'], "depart" => $teacher['shortname'], "course" => $sheet['nc'], "volume" => $volume, "form" => $form, "act" => $act, "formControl" => $formCtrl, "semestr" => $sheet['sem'] == 1 ? 'осенний' : 'весенний', "fioTeacher" => $teacher['fio'], "year" => $yearEnd - 1, "year1" => $yearEnd, "date" => $dtSheet, "att1" => $sheet['att1'], "att2" => $sheet['att2'], "att3" => $sheet['att3'], "rows" => $rowsmark));
开发者ID:rucos,项目名称:abricos-mod-recordbook,代码行数:30,代码来源:print.php

示例3: array

<?php

/**
 * Список последних новостей
 *
 * @version $Id$
 * @package Abricos
 * @subpackage News
 * @copyright Copyright (C) 2012 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;
$p = $brick->param->param;
if ($brick->child[0]->viewcount == 0 && !$p['showempty']) {
    $brick->content = "";
    return;
}
$modRSS = Abricos::GetModule('rss');
$rss = "";
if (!empty($modRSS)) {
    $rss = $brick->param->var['rss'];
}
$brick->content = Brick::ReplaceVarByData($brick->content, array('rss' => $rss));
开发者ID:rucos,项目名称:abricos-mod-news,代码行数:24,代码来源:brick_newsblock.php

示例4: print_r

 * @license http://opensource.org/licenses/mit-license.php MIT License
 * @author Alexander Kuzmin <roosit@abricos.org>
 */
$brick = Brick::$builder->brick;
$brick->param->var['url'] = Abricos::$adress->requestURI;
$p_act = Abricos::CleanGPC('p', 'act', TYPE_STR);
if ($p_act != "upload") {
    return;
}
$modFM = Abricos::GetModule('filemanager');
if (empty($modFM)) {
    return;
}
$fmManager = $modFM->GetFileManager();
/** @var PriceApp $app */
$app = Abricos::GetModule('price')->GetManager()->GetApp();
// отключить проверку ролей в менеджере файлов
$fmManager->RolesDisable();
// отключить проверку свободного места в профиле пользователя
$fmManager->CheckSizeDisable();
$upload = FileManagerModule::$instance->GetManager()->CreateUploadByVar('file0');
$upload->ignoreUploadRole = true;
$errornum = $upload->Upload();
if ($errornum === 0) {
    $app->FileAppend($upload->uploadFileHash, $upload->fileName);
} else {
    print_r($errornum);
}
$dir = Abricos::$adress->dir;
$brick->param->var['command'] = Brick::ReplaceVarByData($brick->param->var['ok'], array("idWidget" => isset($dir[2]) ? $dir[2] : '', "fid" => $upload->uploadFileHash));
开发者ID:abricos,项目名称:abricos-mod-price,代码行数:30,代码来源:upload.php

示例5: foreach

$d->fieldid = $dir[2];
$d->groupid = $dir[3];
$d->studid = $dir[4];
$d->course = $dir[5];
$d->semestr = $dir[6];
$brick = Brick::$builder->brick;
$v =& $brick->param->var;
$recordBook = $modManager->GetRecordBook();
$markList = $recordBook->MarkStudReport($d, true);
$exp = "([а-я])[а-я]+";
$tr = "";
foreach ($markList as $mark) {
    $fctrl = $mark['formcontrol'];
    if ($fctrl === 'Практика') {
        $preg = preg_replace("/" . $exp . "/iu", '$1', $fctrl);
    } else {
        $preg = preg_replace("/" . $exp . " " . $exp . "/iu", '$1$2', $fctrl);
    }
    $arr = array("subject" => $mark['namesubject'], "date" => "", "exam" => "", "credit" => "", "hours" => $mark['numhours'] !== "" ? $mark['numhours'] : $preg);
    if ($mark['mark'] >= 51) {
        $arr['date'] = $mark['date'] ? date('d.m.Y', $mark['date']) : "";
        if ($fctrl == 'Зачет') {
            $arr['credit'] = $mark['mark'] . "(З)";
        } else {
            $arr['exam'] = $mark['mark'] . "(" . $recordBook->SetTradMark($mark['mark'], true) . ")";
        }
    }
    $tr .= Brick::ReplaceVarByData($v['tr'], $arr);
}
$brick->content = Brick::ReplaceVarByData($brick->content, array("rows" => $tr));
开发者ID:rucos,项目名称:abricos-mod-recordbook,代码行数:30,代码来源:print_report.php


注:本文中的Brick::ReplaceVarByData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。