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


PHP Objects::get方法代码示例

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


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

示例1: collectProperties

 public static function collectProperties($objects, $properties, $defaults = null)
 {
     $output = array();
     foreach ($objects as $object) {
         foreach ($properties as $property) {
             $output[] = Objects::get($object, $property, $defaults[$property]);
         }
     }
     return $output;
 }
开发者ID:Nozemi,项目名称:MyFramework,代码行数:10,代码来源:Arrays.class.php

示例2: Exception

 public static function &get($var, $name, $default = null)
 {
     if (is_array($var)) {
         return Arrays::get($var, $name, $default);
     }
     if (is_object($var)) {
         return Objects::get($var, $name, $default);
     }
     throw new Exception("\$var must be either an array or object");
 }
开发者ID:Nozemi,项目名称:MyFramework,代码行数:10,代码来源:Generic.class.php

示例3: toArray

 public static function toArray($value, $items = [], $key = null)
 {
     if (is_array($value)) {
         $arr = [];
         foreach ($value as $v) {
             $a = self::toArray($v, $items, $key);
             if ($key == null) {
                 $arr[] = $a;
             } else {
                 $arr[Objects::get($v, $key)] = $a;
             }
         }
         return $arr;
     }
     if (is_object($value)) {
         if (count($items)) {
             if (count($items) > 1) {
                 $arr = [];
                 foreach ($items as $item) {
                     $arr[$item] = Objects::get($value, $item);
                 }
                 return $arr;
             } else {
                 return Objects::get($value, $items[0]);
             }
         }
         return $value . '';
     }
     return;
 }
开发者ID:alnetosilva,项目名称:novosga,代码行数:30,代码来源:Arrays.php

示例4: Objects

// if(substr($_SERVER['REQUEST_URI'], -1) == '/')
// 	header("Location: ".rtrim($host, '/').rtrim($_SERVER['REQUEST_URI'], '/'));
// specific to this 'app'
require_once $config_dir . "url.php";
require_once $config_dir . "request.php";
// logged in user via .htaccess, .htpasswd
$user = $_SERVER['REMOTE_USER'];
$db = db_connect($user);
$oo = new Objects();
$mm = new Media();
$ww = new Wires();
$uu = new URL();
$rr = new Request();
$js_back = "javascript:history.back();";
// self
$item = $oo->get($uu->id);
// am i using the ternary operator correctly?
// if this url has an id, get the associated object,
// else, get the root object
$name = $item ? strip_tags($item["name1"]) : false;
// document title
$title = $db_name . " | " . $name;
// $nav = $oo->nav_clean($uu->ids);
// used in add.php, edit.php, browse.php
$ancestors = $oo->ancestors($uu->id);
?>
<!DOCTYPE html>
<html>
	<head>
		<title><?php 
echo $title;
开发者ID:O-R-G,项目名称:o-r-g.com,代码行数:31,代码来源:head.php

示例5: Objects

require_once($config);

// specific to this 'app'
$config_dir = $root."/config/";
require_once($config_dir."url.php");

$db = db_connect("guest");

$oo = new Objects();
$mm = new Media();
$ww = new Wires();
$uu = new URL();

// self
if($uu->id)
	$item = $oo->get($uu->id);
else
	$item = $oo->get(0);
$name = strip_tags($item["name1"]);

// document title
$item = $oo->get($uu->id);
$title = $item["name1"] ? $item["name1"] : "Point";
if ($title == "Point") $home = true;

$now_children = $oo->children(1);

$is_report = false;
if($uu->urls[0] == "annual-reports" && count($uu->urls) == 2)
	$is_report = true;
开发者ID:reinfurt,项目名称:POINT,代码行数:30,代码来源:head-.php


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