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


PHP Smarty::clear_all_assign方法代码示例

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


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

示例1: clearVars

 /**
  * Clear all assigned variables
  *
  * Clears all variables assigned to Zend_View either via {@link assign()} or
  * property overloading ({@link __get()}/{@link __set()}).
  *
  * @return void
  */
 public function clearVars()
 {
     if ($this->_smarty instanceof Smarty) {
         $this->_smarty->clear_all_assign();
     } elseif (!empty($this->_smartyMethods['assign'])) {
         unset($this->_smartyMethods['assign']);
     }
 }
开发者ID:roycocup,项目名称:Tests,代码行数:16,代码来源:Smarty.php

示例2: output

 public function output($pFolder)
 {
     Folder::deleteRecursive($pFolder);
     Folder::create($pFolder);
     Folder::create($pFolder . '/classes');
     $smarty = new \Smarty();
     $smarty->clear_all_assign();
     $smartyDir = "includes/libs/core/tools/docs/templates/_cache/";
     $smarty->template_dir = "includes/libs/core/tools/docs/templates";
     $smarty->cache_dir = $smartyDir;
     $smarty->compile_dir = $smartyDir;
     $classIndex = array();
     foreach ($this->packages as $className => $details) {
         $parts = explode("\\", $className);
         $class = array_pop($parts);
         while (in_array($class, $classIndex) && !empty($parts)) {
             $class = $class . '\\' . array_pop($parts);
         }
         $file = 'classes/' . str_replace('\\', '_', $class) . '.html';
         $classIndex[] = array('name' => $class, 'href' => $file);
         $smarty->clear_all_assign();
         $details['name'] = $class;
         $smarty->assign('details', $details);
         file_put_contents($pFolder . $file, Encoding::BOM() . $smarty->fetch("template.class_details.tpl"));
     }
     $this->sortName($classIndex);
     $prefixed_ndx = array();
     foreach ($classIndex as $class) {
         $firstLetter = strtoupper(substr($class['name'], 0, 1));
         if (!array_key_exists($firstLetter, $prefixed_ndx)) {
             $prefixed_ndx[$firstLetter] = array();
         }
         $prefixed_ndx[$firstLetter][] = $class;
     }
     $classIndex = $prefixed_ndx;
     $smarty->clear_all_assign();
     $smarty->assign('classIndex', $classIndex);
     file_put_contents($pFolder . '/classes.html', Encoding::BOM() . $smarty->fetch("template.classes.tpl"));
     $smarty->clear_all_assign();
     file_put_contents($pFolder . '/index.html', Encoding::BOM() . $smarty->fetch("template.index.tpl"));
 }
开发者ID:arno06,项目名称:Achilles,代码行数:41,代码来源:class.Documentor.php

示例3: Clear

 public function Clear($tpl_var = NULL)
 {
     if (is_null($tpl_var)) {
         return parent::clear_all_assign();
     }
     return parent::clear_assign($tpl_var);
 }
开发者ID:raj47i,项目名称:PHP.Fx,代码行数:7,代码来源:theme.php

示例4: combat_report


//.........这里部分代码省略.........
        } else {
            $aidx = sizeof($results[$result["uid"]]["admirals"]);
        }
        $results[$result["uid"]]["admirals"][$aidx]["name"] = dlookup("name", "admirals", "id=" . $result["admiral_id"]);
        if (is_null(dlookup("killed_by", "combat", "admiral_carried=" . $result["admiral_id"]))) {
            $results[$result["uid"]]["admirals"][$aidx]["xp"] = dlookup("value", "admirals", "id=" . $result["admiral_id"]);
            $results[$result["uid"]]["admirals"][$aidx]["newxp"] = dlookup("value", "admirals", "id=" . $result["admiral_id"]) + $result["xp_earned"];
            $results[$result["uid"]]["admirals"][$aidx]["lvlup"] = calculate_admiral_level(dlookup("value", "admirals", "id=" . $result["admiral_id"]) + $result["xp_earned"]) != calculate_admiral_level(dlookup("value", "admirals", "id=" . $result["admiral_id"]));
        }
    }
    $users_query = $GLOBALS["db"]->query("SELECT DISTINCT uid, aid FROM combat") or die($GLOBALS["db"]->error);
    if (!$users_query) {
        return false;
    }
    while ($users_result = $users_query->fetch_assoc()) {
        // Feinde
        $results_query = $GLOBALS["db"]->query("SELECT alliance2 FROM diplomacy dp WHERE status=0 AND \nalliance1=" . $users_result["aid"]) or die($GLOBALS["db"]->error);
        if (!$results_query) {
            return false;
        }
        while (list($results[$users_result["uid"]]["enemies"][]) = $results_query->fetch_row()) {
        }
        // Schiffe gesamt
        $namefield = "CONCAT(p.name, ' ', IF(c.position='L','[unloaded]',\nIF(c.position='T','[on transport]',IF(c.position='U','[landed]',IF(IFNULL(c.killed_special,'')='E',\n'[disabled]',IF(IFNULL(c.killed_special,'')='R', '[captured]', ''))))))";
        $results_query = $GLOBALS["db"]->query("SELECT {$namefield} AS name, \nSUM(c.count_max) AS count FROM combat c INNER JOIN production p \nUSING (prod_id) WHERE uid=" . $users_result["uid"] . " GROUP BY p.name, c.position, c.killed_special") or die($GLOBALS["db"]->error);
        if (!$results_query) {
            return false;
        }
        while ($unit = $results_query->fetch_assoc()) {
            $results[$users_result["uid"]]["ships"][$unit["name"]] = $unit["count"];
        }
        // Schiffe zerstört
        $results_query = $GLOBALS["db"]->query("SELECT {$namefield} AS name, SUM(c.count_max-c.count) AS count,\nIFNULL(c.killed_special,'') AS killed_special FROM combat c INNER JOIN production p \nUSING (prod_id) WHERE uid=" . $users_result["uid"] . " GROUP BY p.name, c.position, c.killed_special") or die($GLOBALS["db"]->error);
        if (!$results_query) {
            return false;
        }
        while ($unit = $results_query->fetch_assoc()) {
            if ($unit["killed_special"] != "E" && $unit["killed_special"] != "R") {
                $results[$users_result["uid"]]["destroyed_ships"][$unit["name"]] = $unit["count"];
            }
        }
        // Schiffe lebendig
        $results_query = $GLOBALS["db"]->query("SELECT {$namefield} AS name, SUM(c.count) AS count,\nIFNULL(c.killed_special,'') AS killed_special FROM combat c INNER JOIN production p \nUSING (prod_id) WHERE c.killed_by IS NULL AND uid=" . $users_result["uid"] . " GROUP BY p.name, c.position, \nc.killed_special") or die($GLOBALS["db"]->error);
        if (!$results_query) {
            return false;
        }
        while ($unit = $results_query->fetch_assoc()) {
            if ($unit["killed_special"] != "E" && $unit["killed_special"] != "R") {
                $results[$users_result["uid"]]["remaining_ships"][$unit["name"]] = $unit["count"];
            }
        }
    }
    // Planetare Schilde berichten
    $query = $GLOBALS["db"]->query("SELECT 'Planetary shields' AS name, SUM(c.shield) AS shieldsum, \nSUM(c.shield_max) AS maxsum FROM combat c INNER JOIN production p USING (prod_id) WHERE c.special \nLIKE 'H%'") or die($GLOBALS["db"]->error);
    while ($result = $query->fetch_assoc()) {
        if ($result["maxsum"] > 0) {
            $results[$puid]["ships"][$result["name"]] = $result["maxsum"];
            $results[$puid]["destroyed_ships"][$result["name"]] = $result["maxsum"] - $result["shieldsum"];
            $results[$puid]["remaining_ships"][$result["name"]] = $result["shieldsum"];
        }
    }
    $combat_smarty->assign("results", $results);
    $users_query = $GLOBALS["db"]->query("SELECT DISTINCT uid FROM combat") or die($GLOBALS["db"]->error);
    if (!$users_query) {
        return false;
    }
    while ($users_result = $users_query->fetch_assoc()) {
        if ($users_result["uid"] < 0) {
            $users[$users_result["uid"]] = "BattleSim Side " . $users_result["uid"] * -1;
        } else {
            $users[$users_result["uid"]] = get_name_by_uid($users_result["uid"]);
        }
    }
    $combat_smarty->assign("users", $users);
    ob_start();
    $combat_smarty->display("battlereport.tpl");
    $report = ob_get_contents();
    ob_end_clean();
    $combat_smarty->clear_all_assign();
    // Report abspeichern
    if (BATTLE_DESTROY && $combat["shots_fired"] > 0) {
        $week = dlookup("week", "timeinfo");
        $sth = $GLOBALS["db"]->query("INSERT INTO battlereports SET pid={$pid}, sid={$sid}, \nreport='" . addslashes($report) . "', week={$week}") or die($GLOBALS["db"]->error);
        $report_id = $GLOBALS["db"]->insert_id;
        $query = $GLOBALS["db"]->query("SELECT DISTINCT uid FROM combat") or die($GLOBALS["db"]->error);
        while (list($id) = $query->fetch_row()) {
            $sth = $GLOBALS["db"]->query("INSERT INTO battlereports_user (uid, rid) VALUES ({$id}, {$report_id})") or die($GLOBALS["db"]->error);
        }
        $query = $GLOBALS["db"]->query("SELECT DISTINCT aid FROM combat") or die($GLOBALS["db"]->error);
        while (list($id) = $query->fetch_row()) {
            $sth = $GLOBALS["db"]->query("INSERT INTO battlereports_alliance (aid, rid) VALUES ({$id}, {$report_id})") or die($GLOBALS["db"]->error);
        }
    }
    if (COMBAT_VERBOSE) {
        echo "OK! (" . round(read_timer(1), 4) . "s)" . COMBAT_NEWLINE . COMBAT_NEWLINE;
    }
    if (!BATTLE_DESTROY) {
        echo "{$report}" . COMBAT_NEWLINE . COMBAT_NEWLINE;
    }
}
开发者ID:spaceregents,项目名称:spaceregents,代码行数:101,代码来源:krieg.inc.php

示例5: initControlContext

 /**
  * Creates a Smarty object.
  *
  * @return Smarty    initialized (cleared) Smarty context.
  * @throws Exception the execute method will catch
  *                   and rethrow as a <code>BuildException</code>
  */
 public function initControlContext()
 {
     $this->context->clear_all_assign();
     return $this->context;
 }
开发者ID:xxspartan16,项目名称:BMS-Market,代码行数:12,代码来源:SmartyTask.php

示例6: clearVars

 /**
  * Clear all assigned variables
  *
  * Clears all variables assigned to Zend_View either via
  * {@link assign()} or property overloading
  * ({@link __get()}/{@link __set()}).
  *
  * @return void
  */
 public function clearVars()
 {
     $this->smarty->clear_all_assign();
 }
开发者ID:jsyzchen,项目名称:chen-yaf,代码行数:13,代码来源:Adapter.php

示例7: isset

$smarty->assign("Contact_Phone", $Contact_Phone);
$smarty->assign("Contact_Fax", $Contact_Fax);
$smarty->assign("SUPPORT_EMAIL", $SUPPORT_EMAIL);
$smarty->assign("SITE_ADV_SUPPORT_TEXT", $SITE_ADV_SUPPORT_TEXT);
$smarty->assign("SITE_JS", SITE_JS);
$smarty->assign("S_JQUERY", S_JQUERY);
$smarty->assign("CK_EDITOR_PATH", CK_EDITOR_PATH);
$smarty->assign("CK_EDITOR_URL", CK_EDITOR_URL);
$smarty->assign("SITE_JS_AJAX", SITE_JS_AJAX);
$smarty->assign("SITE_VALIDATION_JS", SITE_VALIDATION_JS);
$smarty->assign("SITE_CONTENT_JS", SITE_CONTENT_JS);
// $smarty->assign("S_PROTOTYPE",S_PROTOTYPE);
$smarty->assign("SITE_CO_URL", SITE_CO_URL);
$smarty->assign("COPYRIGHT_TEXT", $COPYRIGHT_TEXT);
$smarty->assign("PRJ_DB_PREFIX", PRJ_DB_PREFIX);
$smarty->assign("PRJ_CONST_PREFIX", PRJ_CONST_PREFIX);
$smarty->assign("bodyid", $bodyid);
$smarty->assign("bodycls", $bodycls);
$smarty->assign("dvid", $dvid);
$smarty->assign("mdivid", $mdivid);
$smarty->assign("cssfile", $cssfile);
$curSessid = isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID']) ? $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'] : '';
$smarty->assign("curSessid", $curSessid);
//Prints($_SESSION);exit;
//display index file tpl
$smarty->display("index.tpl");
$smarty->clear_all_assign();
$dbobj->MySQLClose();
unset($dbobj);
include_once S_SECTIONS . "/member/atlast.php";
exit;
开发者ID:nstungxd,项目名称:F2CA5,代码行数:31,代码来源:loadsection.php

示例8: clear

 function clear()
 {
     $this->smarty->clear_all_assign();
     $this->smarty->assign('context', $this->context);
 }
开发者ID:fchaose,项目名称:qeephp,代码行数:5,代码来源:smarty.php

示例9: setVariables

 /**
  * template variable setter
  *
  * clear previous Smarty assignments
  *
  * @param  array $variables
  * @return SimpleMail_Template_SmartyRenderer
  */
 public function setVariables(array $variables)
 {
     $this->smarty->clear_all_assign();
     return parent::setVariables($variables);
 }
开发者ID:blerou,项目名称:SimpleMail,代码行数:13,代码来源:SmartyRenderer.php

示例10: unsetAll

 public function unsetAll()
 {
     $this->tpl->clear_all_assign();
 }
开发者ID:saiber,项目名称:www,代码行数:4,代码来源:SmartyRenderer.php


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