本文整理汇总了PHP中Output::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::assign方法的具体用法?PHP Output::assign怎么用?PHP Output::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::assign方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($name, $arguments)
{
try {
$replaced = 0;
$act = str_replace('action_', '', $name, $replaced);
if ($replaced == 0) {
throw new Exception("Нет такого метода {$name}");
}
$act = $this->getName() . "_" . $act;
if (class_exists($act)) {
$this->table = new $act();
} else {
$this->table = new sqltable($act);
}
if ($this->table == null) {
throw new Exception("Не возможно создать такую таблицу {$act}");
}
} catch (Exception $e) {
return $this->_404("[class=" . get_class($this) . "] : " . $e->getMessage());
}
if ($arguments[nooutput]) {
return;
}
if ($this->table->run()) {
if (Ajax::isAjaxRequest()) {
return $this->table->getOutput();
}
$this->setOutputAssigns();
Output::assign('menu', $this->getIndexMenu());
Output::setContent($this->table->getOutput());
return $this->fetch("body_base.tpl");
}
}
示例2: action_index
public function action_index() {
$menuitems = "";
$fkey = 0;
foreach ($this->items as $item) {
$text = $type = $noajax = $picture = $right = '';
extract($item);
//echo $type."_".$right;
if ($this->parent) {
$righttype = get_class($this->parent) . '_' . $type;
} else {
$righttype = $type;
}
if ($right and !Auth::getInstance()->getRights($righttype,'view'))
continue;
if ($type == "newline") {
//$menuitems .= "</tr><tr>";
} else {
$uri = new UriConstructor();
$uri->clear();
Output::assign('hotkey', $fkey++<11?"Ctrl + f{$fkey }":"");
Output::assign('text',$text);
Output::assign('hyphertext',hypher::addhypher($text));
Output::assign('ajax',($item[noajax]?'':"data-silent='{$this->parent->getMainTarget()}' legotarget='{$this->parent->getName()}'"));
Output::assign('type',$type);
Output::assign('url',$uri->set($this->parent->getName(),$type)->url());
Output::assign('selected',($this->parent->getAction()==$type?" menu-item-sel":""));
Output::assign('picture', (empty($picture) ? "" : "style='background-image: URL(\"/picture/{$picture}\");'"));
$menuitems .= $this->fetch('menu_item.tpl');
}
}
Output::assign('menuitems',$menuitems);
return $this->fetch('menu.tpl');
}
示例3: fetch
/**
* Отрисовать по шаблону
* @param String $template
* @param array $date
* @return String
*/
public function fetch($template, $data = false)
{
// найти шаблон, он может быть и у любого потомка этого класса, они же и друг от друга наследуют
$dir = $this->dir;
$class = get_class($this);
while (!file_exists($dir . '/' . $template) && !file_exists($template)) {
$class = get_parent_class($class);
if ($class) {
$ref = new ReflectionClass($class);
if (!$ref->isAbstract()) {
$obj = new $class();
$dir = $obj->getDir();
}
} else {
return '';
}
}
// Если переданы данные, сделать обозначения
if ($data !== false) {
foreach ($data as $key => $value) {
Output::assign($key, $value);
}
}
$templatedir = Output::getTemplateCompiler()->getTemplateDir();
Output::getTemplateCompiler()->setTemplateDir($dir);
$content = Output::fetch($template);
Output::getTemplateCompiler()->setTemplateDir($templatedir);
return $content;
}
示例4: showrec
public function showrec($rec)
{
$out = '';
Output::assign('linkclass', 'path');
Output::assign('sllink', "file://" . $rec[path]);
Output::assign('type', 'Путь к блоку');
Output::assign('slid', '');
$out .= $this->fetch('link.tpl');
Output::assign('type', 'СЛ-');
Output::assign('sllink', $rec[sl][link]);
Output::assign('slid', $rec[sl][id]);
Output::assign('linkclass', 'filelink');
$out .= $this->fetch('link.tpl');
Output::assign('type', 'ТЗ-');
Output::assign('sllink', $rec[tz][link]);
Output::assign('slid', $rec[tz][id]);
$out .= $this->fetch('link.tpl');
$out .= "Письма: " . $rec[letter][link];
// Добавить информацию о платах в блоке
foreach ($rec[boards] as $value) {
$files = $value[filelinks][link];
$out .= $this->fetch('board.tpl', array('boardname' => $value["board_name"], 'filelinks' => $files));
}
Output::assign('dozaplink', $rec[dozaplink]);
Output::assign('filelinks', $out);
$out = $this->fetch('dozap.tpl');
$out .= "<script>\$('form[name=dozap]').submit(function(){\n \$().lego.load('lanch_nzap', \$(this).attr('action'),\$(this).serialize());\n reload_table();\n return false;\n });</script>";
$out .= $this->addComments($rec[id], 'lanch');
return $out;
}
示例5: action_help
public function action_help()
{
if (Ajax::isAjaxRequest()) {
return $this->fetch("help.tpl");
} else {
CTitle::addSection('Помощь');
$this->setOutputAssigns();
Output::assign('menu', $this->getIndexMenu());
Output::setContent($this->fetch("help.tpl"));
return $this->fetch("body_base.tpl");
}
}
示例6: action_blocks
public function action_blocks()
{
$_SESSION[customer_id] = '';
$this->table = new orders_blocks();
if ($this->table->run()) {
if (Ajax::isAjaxRequest()) {
return $this->table->getOutput();
}
$this->setOutputAssigns();
Output::assign('menu', $this->getIndexMenu());
Output::setContent($this->table->getOutput());
return $this->fetch("body_base.tpl");
}
}
示例7: __call
public function __call($name, $arguments)
{
$arguments[nooutput] = true;
parent::__call($name, $arguments);
$this->need_yaer_arc = $this->table->model->getNeedArc();
//console::getInstance()->out("lss=".Auth::$lss." ".print_r($_SESSION,true));
if ($this->table->run()) {
if (Ajax::isAjaxRequest()) {
return $this->table->getOutput();
}
$this->setOutputAssigns();
Output::assign('menu', $this->getIndexMenu());
Output::setContent($this->table->getOutput());
return $this->fetch("body_base.tpl");
}
}
示例8: action_index
public function action_index($show=false) {
Output::assign('linkshowbash',$this->actUri('showbash')->url());
Output::assign('linkhidebash',$this->actUri('hidebash')->url());
Output::assign('linkplusbash',$this->actUri('plusbash')->url());
Output::assign('linkminusbash',$this->actUri('minusbash')->url());
if ($_SESSION[bashcite]) {
$ret = $this->_getcite();
Output::assign('bashcite',$ret);
$ret = $this->fetch("bashcite.tpl");
} else {
$ret = $this->fetch("bashcitehide.tpl");
}
if (Ajax::isAjaxRequest())
return $ret;
else
return "<div id='bashcite'>{$ret}</div>";
}
示例9: getRasschet
public function getRasschet($rec)
{
extract($rec);
$filelink = fileserver::createdironserver($filename);
$excel = file_get_contents($this->getDir() . "/" . $template);
if (fileserver::savefile($filelink . ".txt", $rec)) {
// сохранить
if (fileserver::savefile($filelink, $excel)) {
Output::assign('rlink', fileserver::sharefilelink($filelink));
$out = $this->fetch('rlink.tpl');
$res[filename] = $filename;
$res[result] = true;
} else {
$out = "Не удалось записать файл xls";
$res[result] = false;
}
} else {
$out = "Не удалось создать файл txt";
$res[result] = false;
}
$res[out] = $out;
return $res;
}
示例10: action_userwin
/**
* Действие по клику по окну "показать пользователей"
* @return string теккст окна с данными
*/
public function action_userwin() {
Output::assign('users', $this->m->userwin());
return $this->fetch('adminhere.tpl');
}
示例11: run
/**
* Оснновной поток исполнения
* @return this сам текущий лего, для сквозных вызовов
*/
public function run()
{
$this->beforeRun();
Output::assign("lego", $this);
$act = $this->getAction();
$method_name = "action_{$act}";
try {
$this->current_action = $act;
$this->output = call_user_func_array(array($this, $method_name), $this->getActionParams());
} catch (Exception $e) {
$this->output = $this->_404("wrong action ({$method_name}) [class=" . get_class($this) . "]" . $e->getMessage());
}
Output::assign("lego", $this->runner());
return $this->afterRun();
}
示例12: showcoment
public function showcoment($rec)
{
Output::assignAll($rec);
Output::assign('deleteurl', $this->owner->actUri('deletecomment', $rec["id"])->ajaxurl($this->owner->getName()));
$out = $this->fetch(__DIR__ . '/coment.tpl');
return $out;
}
示例13: action_index
public function action_index() {
$m = new birthdays_model();
Output::assign('birthdays',$m->getToday());
return $this->fetch("birthdays.tpl");
}
示例14: showmplink
public function showmplink($rec)
{
$filename = "z:\\Заказчики\\{$rec[customer]}\\{$rec[blockname]}\\Мастерплаты\\МП-{$rec[date]}-{$rec[mp_id]}.xls";
$filename = fileserver::createdironserver($filename);
$excel = file_get_contents($this->getDir() . "/mp.xls");
if (fileserver::savefile($filename, $excel)) {
$mp["_date_"] = date("d.m.Y");
$mp["_number_"] = sprintf("%08d\n", $rec[mp_id]);
if (fileserver::savefile($filename . ".txt", $mp)) {
Output::assign('mplink', fileserver::sharefilelink($filename));
Output::assign('mpid', $rec[mp_id]);
$out = $this->fetch('mplink.tpl');
} else {
$out = "Не удалось создать файл txt";
}
} else {
$out = "Не удалось создать файл xls" . print_r($rec, true);
}
return $out;
}