本文整理汇总了PHP中value函数的典型用法代码示例。如果您正苦于以下问题:PHP value函数的具体用法?PHP value怎么用?PHP value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了value函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: get
/**
* Get the language line as a string.
*
* <code>
* // Get a language line
* $line = Lang::line('validation.required')->get();
*
* // Get a language line in a specified language
* $line = Lang::line('validation.required')->get('sp');
*
* // Return a default value if the line doesn't exist
* $line = Lang::line('validation.required')->get(null, 'Default');
* </code>
*
* @param string $language
* @param string $default
* @return string
*/
public function get($language = null, $default = null)
{
//ff($language); die();
// If no default value is specified by the developer, we'll just return the
// key of the language line. This should indicate which language line we
// were attempting to render and is better than giving nothing back.
if (is_null($default)) {
$default = $this->key;
}
if (is_null($language)) {
$language = $this->language;
}
list($bundle, $file, $line) = $this->parse($this->key);
$identifier_as_line = $line;
// If the file does not exist, we'll just return the default value that was
// given to the method. The default value is also returned even when the
// file exists and that file does not actually contain any lines.
if (!static::load($bundle, $language, $file)) {
return value($identifier_as_line);
//return value($default);
}
$lines = static::$lines[$bundle][$language][$file];
$line = array_get($lines, $line, $identifier_as_line);
//$line = array_get($lines, $line, $default);
// If the line is not a string, it probably means the developer asked for
// the entire language file and the value of the requested value will be
// an array containing all of the lines in the file.
if (is_string($line)) {
foreach ($this->replacements as $key => $value) {
$line = str_replace(':' . $key, $value, $line);
}
}
return $line;
}
开发者ID:juaniiie,项目名称:mwi,代码行数:52,代码来源:Lang.php
示例17: CoordinatesInput
/**
* standard constructor
* @param string Text that is to be shown as description or label with your object.
* @param string Table, you want to connect with the object.
* @param string $longitude,column, which stores the longitude
* @param string $latitude, columnd, which stores the latitude
* @param string $row_identifier Usually to be generated with form->setPK. Identifies the
* row in db, you want to affect with operation. Keep empty for insert. (Example: stdEDForm)
*/
function CoordinatesInput($label, $table, $longitude, $latitude, $row_identifier = "1")
{
global $page, $page_state, $forceLoadFromDB, $page_action;
DBO::DBO($label, $table, $longitude, $row_identifier, "");
$this->lng = $longitude;
$this->lat = $latitude;
$this->vlng = 0;
$this->vlat = 0;
if ($page_state == "processing" && value("changevariation") != "GO" && !($forceLoadFromDB == "yes")) {
$this->vlng = value("coordY", "NUMERIC", "0");
$this->vlat = value("coordX", "NUMERIC", "0");
} else {
if (($page_action == "UPDATE" || $page_action == "DELETE") && $this->row_identifier != "1") {
$this->vlng = getDBCell($table, $longitude, $row_identifier);
$this->vlat = getDBCell($table, $latitude, $row_identifier);
}
}
include_once "nxgooglemapsapi.php";
$this->api = new NXGoogleMapsAPI();
$this->api->setWidth(590);
$this->api->setHeight(350);
$this->api->addControl(GLargeMapControl);
$this->api->addControl(GOverviewMapControl);
$this->api->addControl(GMapTypeControl);
$this->api->setCenter(50, 10);
$this->api->setZoomFactor(4);
if ($this->vlng != 0 || $this->vlat != 0) {
$this->api->addDragMarker($this->vlng, $this->vlat);
}
$page->headerPayload = $this->api->getHeadCode();
$page->onLoad .= $this->api->getOnLoadCode();
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:41,代码来源:coords_input.php
示例18: 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);
while (($segment = array_shift($key)) !== null) {
if ($segment === '*') {
if ($target instanceof Collection) {
$target = $target->all();
} elseif (!is_array($target)) {
return value($default);
}
$result = Arr::pluck($target, $key);
return in_array('*', $key) ? Arr::collapse($result) : $result;
}
if (Arr::accessible($target) && Arr::exists($target, $segment)) {
$target = $target[$segment];
} elseif (is_object($target) && isset($target->{$segment})) {
$target = $target->{$segment};
} else {
return value($default);
}
}
return $target;
}
开发者ID:sa7bi,项目名称:euro16,代码行数:34,代码来源:helpers.php
示例19: process_object_update
/**
* Updates the changes towards the object with the given id.
* @param integer Id of the item, to be deleted.
*/
function process_object_update($id)
{
global $lang, $errors, $db, $page_action, $page_state;
$cond = $this->item_pkname . " = {$id}";
// configure DBO
$page_action = "UPDATE";
$page_state = "processing";
$tip = new TextInput($lang->get("name"), $this->item_table, $this->item_name, $cond, "type:text,size:32,width:200", "UNIQUE&MANDATORY");
$this->add($tip);
$this->add(new Hidden("editing", $id));
$this->check();
$this->drawPage = "editing";
if ($errors == "") {
$name = value($this->item_table . "_" . $this->item_name);
global $c_magic_quotes_gpc;
if ($c_magic_quotes_gpc == 1) {
$name = str_replace("\\", "", $name);
}
$pname = parseSQL($name);
$sql = "UPDATE " . $this->item_table . " SET " . $this->item_name . " = '" . $pname . "' WHERE " . $this->item_pkname . " = {$id}";
$query = new query($db, $sql);
$query->free();
}
if ($errors == "") {
$this->addToTopText($lang->get("savesuccess"));
} else {
$this->addToTopText($lang->get("procerror"));
$this->setTopStyle("errorheader");
}
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:34,代码来源:metascheme.php
示例20: load
/**
* Action (JsonRpc)
*
* @param Request $request
* @param Response $response
* @return mixed
*/
public function load(Request $request = null, Response $response = null)
{
$json = $request->getAttribute('json');
$params = value($json, 'params');
$result = ['status' => 1];
return $result;
}
开发者ID:odan,项目名称:psr7-full-stack,代码行数:14,代码来源:IndexController.php
注:本文中的value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论