Smarty Assign () how this function is defined

Source: Internet
Author: User
Who can post the code of this function, and how it works


Reply to discussion (solution)

You can use the IDE to find out.

smarty_internal_data.php

/** * Assigns a Smarty variable * * @param array|string $tpl _var the template variable name (s) * @param mi  Xed $value the value to assign * @param boolean $nocache If true all output of this variable would be is not Cached * @param boolean $scope The scope the variable would have (local,parent or root) */Public function  IGN ($tpl _var, $value = null, $nocache = False) {if (Is_array ($tpl _var)) {foreach ($tpl _var as $_key                        = = $_val) {if ($_key! = ") {if (Isset ($this->tpl_vars[$_key])) {                        $this->tpl_vars[$_key]->value = $_val;                    $this->tpl_vars[$_key]->nocache = $nocache;                    } else {$this->tpl_vars[$_key] = new Smarty_variable ($_val, $nocache); }}}} or else {if ($tpl _var! = ") {if (Isset ($this->tpl_va rs[$Tpl_var]) {$this->tpl_vars[$tpl _var]->value = $value;                $this->tpl_vars[$tpl _var]->nocache = $nocache;                } else {$this->tpl_vars[$tpl _var] = new Smarty_variable ($value, $nocache); }            }        }    }


The above is the Smarty in assign () This function is how to define the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.