本文整理汇总了PHP中CreateRenderer函数的典型用法代码示例。如果您正苦于以下问题:PHP CreateRenderer函数的具体用法?PHP CreateRenderer怎么用?PHP CreateRenderer使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CreateRenderer函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetDB
{
if (!$this->validate()) {
return FALSE;
}
$vDB = GetDB();
$vValues = $this->getSubmitValues(TRUE);
// $vId = $vValues['id'];
$vRecord = array();
if (!empty($vValues['id'])) {
$vRecord['id'] = $vValues['id'];
}
CopyRecordStrValue($vRecord, $vValues, 'name');
$vResult = $vDB->InsertOrUpdateById('rb_directions', $vRecord);
// var_dump($vRecord);
// var_dump($vDB);
return $vResult;
}
}
$vId = array_key_exists('id', $_GET) ? $_GET['id'] : '';
$vForm = new TEditor($vId);
if (!$vForm->Save()) {
$vTemplate =& CreateTemplate();
$vRenderer =& CreateRenderer($vTemplate);
$vForm->accept($vRenderer);
$vView =& new TBaseView();
$vView->form = $vRenderer->toObject();
$vTemplate->compile('refs/direction_edit.html');
$vTemplate->outputObject($vView);
} else {
RedirectToList('directions.html');
}
示例2: _renderForm
function _renderForm(&$page)
{
global $gTemplateName;
$vContainer =& $page->controller->container();
$vTemplate =& CreateTemplate();
$vRenderer =& CreateRenderer($vTemplate);
$page->accept($vRenderer);
$vView = new TPageView();
$vView->page =& $page;
$vView->form =& $vRenderer->toObject();
$vDefaults =& $vContainer['defaults'];
$vValues =& $vContainer['values'];
$vBaseInfoDefaults =& $vDefaults['BaseInfo'];
$vBaseInfoValues =& $vValues['BaseInfo'];
$vFirstPageDefaults =& $vDefaults[DatePageName(0)];
$vFirstPageValues =& $vValues[DatePageName(0)];
$vView->case_id = @$vBaseInfoDefaults['id'];
$vView->create_time = @Date2ReadableLong($vBaseInfoDefaults['create_time']);
$vBaseInfo =& $vBaseInfoDefaults;
if (DataAvailable($vBaseInfoValues)) {
$vBaseInfo =& $vBaseInfoValues;
}
$vView->name = FormatNameEx($vBaseInfo);
if (DocsEmpty($vBaseInfo)) {
$vView->docs_is_empty = true;
}
$vView->category = @FormatCategory($vBaseInfo['employment_category_id']);
$vView->age = 'полных лет ' . CalcAge(DateValueToStr($vBaseInfo['born_date']));
$vView->paytype = @GetPaytypeName($vBaseInfo['paytype']);
if (DataAvailable($vFirstPageValues)) {
$vView->disability_from_date = empty($vFirstPageValues['ill_doc']) ? '' : Date2ReadableLong(DateValueToStr($vFirstPageValues['disability_from_date']));
} else {
$vView->disability_from_date = empty($vFirstPageDefaults['ill_doc']) ? '' : Date2ReadableLong($vBaseInfoDefaults['disability_from_date']);
}
if (!empty($vContainer['_PopupURL'])) {
$vView->popup_url = $vContainer['_PopupURL'];
unset($vContainer['_PopupURL']);
}
$vTemplate->compile($gTemplateName);
$vTemplate->outputObject($vView);
}