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


PHP value函数代码示例

本文整理汇总了PHP中value函数的典型用法代码示例。如果您正苦于以下问题:PHP value函数的具体用法?PHP value怎么用?PHP value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: process

		/**
		  * processes the form. Used internally only.
		  */
		function process() {
			global $goon, $lang, $c, $errors;

			if ($goon == $lang->get("commit")) {

				// process all the registered checks.	
				for ($i = 0; $i < count($this->actions); $i++) {
					if (value($this->actions[$i][0]) != "0") {
						$this->actions[$i][1]->process($this->actions[$i][0]);

						if ($errors == "") {
							$this->addToTopText("<br><b>" . $this->actions[$i][2] . " ". $lang->get("var_succeeded"). "</b>");
						} else {
							$this->addToTopText($lang->get("error"));
							$this->setTopStyle("headererror;");
						}
					}
				}
			} else if ($goon == $lang->get("cancel")) {
				global $db;
				$db->close();
				if ($this->backpage == "") {				
				   header ("Location: " . $c["docroot"] . "api/userinterface/page/blank_page.php");
				} else {
				   header ("Location: " . $c["docroot"] . $this->backpage);
				}
				exit;
			}
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:32,代码来源:commitform.php

示例2: syncVariations

/**
 * syncronize variations with entered data to the database.
 * The configuration for this function must be set manually.
 * I.E. there must be the $oid-Variable set and there must(!)
 * be also the global vars content_variations_VARIATION_ID_XX
 * and content_MODULE_ID
 * set which are automatically set by the SelectMultiple2Input.
 */
function syncVariations()
{
    global $db, $oid, $content_MODULE_ID;
    $module = value("content_MODULE_ID", "NUMERIC");
    if ($module == "0") {
        $module = $content_MODULE_ID;
    }
    includePGNSource($module);
    //delete all variations first.
    $del = "UPDATE content_variations SET DELETED=1 WHERE CID = {$oid}";
    $query = new query($db, $del);
    // get list of variations
    $variations = createNameValueArray("variations", "NAME", "VARIATION_ID", "DELETED=0");
    for ($i = 0; $i < count($variations); $i++) {
        $id = $variations[$i][1];
        if (value("content_variations_VARIATION_ID_" . $id) != "0") {
            // create or restore variation
            // check, if variations already exists and is set to deleted.
            $sql = "SELECT COUNT(CID) AS ANZ FROM content_variations WHERE CID = {$oid} AND VARIATION_ID = {$id}";
            $query = new query($db, $sql);
            $query->getrow();
            $amount = $query->field("ANZ");
            if ($amount > 0) {
                $sql = "UPDATE content_variations SET DELETED=0 WHERE CID = {$oid} AND VARIATION_ID = {$id}";
            } else {
                $fk = nextGUID();
                $sql = "INSERT INTO content_variations (CID, VARIATION_ID, FK_ID, DELETED) VALUES ( {$oid}, {$id}, {$fk}, 0)";
                $PGNRef = createPGNRef($module, $fk);
                $PGNRef->sync();
            }
            $query = new query($db, $sql);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:42,代码来源:synchronize.php

示例3: get

 /**
  * Get an item from the collection by key.
  *
  * @param  mixed  $key
  * @param  mixed  $default
  * @return mixed
  */
 public function get($key, $default = null)
 {
     if ($this->offsetExists($key)) {
         return $this->offsetGet($key);
     }
     return value($default);
 }
开发者ID:jooorooo,项目名称:modulator,代码行数:14,代码来源:Collection.php

示例4: get

 /**
  * Get an item from the collection by key.
  *
  * @param mixed $key
  * @param mixed $default
  *
  * @return mixed|static
  */
 public function get($key, $default = null)
 {
     if ($this->offsetExists($key)) {
         return is_array($this->items[$key]) ? new static($this->items[$key]) : $this->items[$key];
     }
     return value($default);
 }
开发者ID:phanstasmal,项目名称:telegram-bot-sdk,代码行数:15,代码来源:BaseObject.php

示例5: get

 public static function get($path, $default = null)
 {
     if (file_exists($path)) {
         return file_get_contents($path);
     }
     return value($default);
 }
开发者ID:jura-php,项目名称:jura,代码行数:7,代码来源:File.php

示例6: get

 /**
  * @param string $filter
  * @param mixed $default
  *
  * @return Filter
  */
 public function get($filter, $default = null)
 {
     if ($this->offsetExists($filter)) {
         return $this->items[$filter];
     }
     return value($default);
 }
开发者ID:lazychaser,项目名称:shopping,代码行数:13,代码来源:Collection.php

示例7: dataGet

 function dataGet($target, $key, $default = null)
 {
     if (is_null($key)) {
         return $target;
     }
     foreach (explode('.', $key) as $segment) {
         if (is_array($target)) {
             if (!array_key_exists($segment, $target)) {
                 return value($default);
             }
             $target = $target[$segment];
         } elseif ($target instanceof \ArrayAccess) {
             if (!isset($target[$segment])) {
                 return value($default);
             }
             $target = $target[$segment];
         } elseif (is_object($target)) {
             if (!isset($target->{$segment})) {
                 return value($default);
             }
             $target = $target->{$segment};
         } else {
             return value($default);
         }
     }
     return $target;
 }
开发者ID:suricate-php,项目名称:framework,代码行数:27,代码来源:Helper.php

示例8: data_get

/**
 * Get an item from an array or object using "dot" notation.
 *
 * @param  mixed   $target
 * @param  string|array  $key
 * @param  mixed   $default
 * @return mixed
 */
function data_get($target, $key, $default = null)
{
    if (is_null($key)) {
        return $target;
    }
    $key = is_array($key) ? $key : explode('.', $key);
    foreach ($key as $segment) {
        if (is_array($target)) {
            if (!array_key_exists($segment, $target)) {
                return value($default);
            }
            $target = $target[$segment];
        } elseif ($target instanceof ArrayAccess) {
            if (!isset($target[$segment])) {
                return value($default);
            }
            $target = $target[$segment];
        } elseif (is_object($target)) {
            $method = 'get' . ucfirst($segment);
            if (isset($target->{$segment})) {
                $target = $target->{$segment};
            } elseif (is_callable([$target, $method])) {
                $target = $target->{$method}();
            } else {
                return value($default);
            }
        } else {
            return value($default);
        }
    }
    return $target;
}
开发者ID:Evertt,项目名称:mvc-concept,代码行数:40,代码来源:laravel-helper-override.php

示例9: processForm

/**
 * Process the formfields, if set. Takes fields pgnratingcomment<id>, pgnratingvote<id>,
 * pgnratingsend<id>
 */
function processForm($sourceId)
{
    if (value("pgnratingsend" . $sourceId) == "1") {
        return saveData(value("pgnrating" . $sourceId, "NUMERIC"), value("pgnratingcomment" . $sourceId, "", ""), $sourceId);
    }
    return false;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:11,代码来源:rater.php

示例10: get

 public function get($key, $default = NULL)
 {
     if ($this->offsetExists($key)) {
         return $this->items[$key]['response'];
     }
     return value($default);
 }
开发者ID:jamesprices,项目名称:iep-printing-php,代码行数:7,代码来源:Collection.php

示例11: rule

 public function rule($rule, $condition = true)
 {
     if (value($condition) && !in_array($rule, $this->rules)) {
         $this->rules[] = $rule;
     }
     return $this;
 }
开发者ID:zhwei,项目名称:laravel-lego,代码行数:7,代码来源:ValidationPlugin.php

示例12: env

 function env($key, $default = null)
 {
     if (isset($_ENV[$key])) {
         $value = $_ENV[$key];
     } else {
         return value($default);
     }
     switch (strtolower($value)) {
         case 'true':
         case '(true)':
             return true;
         case 'false':
         case '(false)':
             return false;
         case 'empty':
         case '(empty)':
             return '';
         case 'null':
         case '(null)':
             return;
     }
     if (preg_match('/^"[^"]+"$/', $value)) {
         return substr($value, 1, -1);
     } else {
         return $value;
     }
 }
开发者ID:emilianobovetti,项目名称:brewis,代码行数:27,代码来源:compatibility.php

示例13: env

 /**
  * Gets the value of an environment variable. Supports boolean, empty and null.
  *
  * @param  string $key
  * @param  mixed  $default
  *
  * @return mixed
  */
 function env($key, $default = NULL)
 {
     $value = getenv($key);
     if ($value === FALSE) {
         return value($default);
     }
     switch (strtolower($value)) {
         case 'true':
         case '(true)':
             return TRUE;
         case 'false':
         case '(false)':
             return FALSE;
         case 'empty':
         case '(empty)':
             return '';
         case 'null':
         case '(null)':
             return NULL;
     }
     if (strlen($value) > 1 && Lib::starts_with('"', $value) && Lib::ends_with('"', $value)) {
         return substr($value, 1, -1);
     }
     return $value;
 }
开发者ID:formula9,项目名称:framework,代码行数:33,代码来源:helpers.php

示例14: env

 function env($key, $default = null)
 {
     $value = getenv($key);
     if ($value === false) {
         return value($default);
     }
     switch (strtolower($value)) {
         case 'true':
         case '(true)':
             return true;
         case 'false':
         case '(false)':
             return false;
         case 'empty':
         case '(empty)':
             return '';
         case 'null':
         case '(null)':
             return;
     }
     if ($value[0] === '"' && $value[strlen($value) - 1] === '"') {
         return substr($value, 1, -1);
     }
     return $value;
 }
开发者ID:sevenymedia,项目名称:bulksmscenter-http-api,代码行数:25,代码来源:helpers.php

示例15: param

 /**
  * Gets a parameters
  * @param  string          $name    The parameter name
  * @param  mixed|\Closure  $default Default value if parameter is not set
  * @return mixed
  */
 public function param($name, $default = null)
 {
     if (isset($this->parameters[$name])) {
         return $this->parameters[$name];
     }
     return value($default);
 }
开发者ID:arcesilas,项目名称:larablock,代码行数:13,代码来源:Block.php


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