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


PHP Object::get方法代码示例

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


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

示例1: __get

 /**
  * Uses the static method approach if our DI var is null
  *
  * @return Object
  * @author Dan Cox
  */
 public function __get($service)
 {
     if (is_null($this->DI)) {
         return DI::get($service);
     }
     return $this->DI->get($service);
 }
开发者ID:danzabar,项目名称:alice,代码行数:13,代码来源:DependencyInjectionAware.php

示例2: display

 function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     //check if user access level allows view
     $user = JFactory::getUser();
     $groups = $user->getAuthorisedViewLevels();
     $access = isset($this->form->frontendaccess) && in_array($this->form->frontendaccess, $groups) ? true : false;
     if ($access == false) {
         JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     // get params from menu
     $this->menu_params = $this->state->get('params');
     if ($this->menu_params['menu-meta_description']) {
         $this->document->setDescription($this->menu_params['menu-meta_description']);
     }
     if ($this->menu_params['menu-meta_keywords']) {
         $this->document->setMetadata('keywords', $this->menu_params['menu-meta_keywords']);
     }
     //get Item id d
     $this->itemid = $this->state->get('itemid', '0');
     //get form id
     $this->id = JFactory::getApplication()->input->getInt('id', -1);
     if ($this->_layout == "detail") {
         // Get data from the model
         $this->item = $this->get('Detail');
     }
     // Get data from the model
     $this->form = $this->get('Form');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->fields = $this->get('Datafields');
     parent::display($tpl);
 }
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:35,代码来源:view.html.php

示例3: addToolbar

 /**
  * Display the toolbar.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     Request::setVar('hidemainmenu', 1);
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == User::get('id'));
     $canDo = UsersHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
     Toolbar::title(Lang::txt('COM_USERS_NOTES'), 'user');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count(User::getAuthorisedCategories('com_users', 'core.create')))) {
         Toolbar::apply('note.apply');
         Toolbar::save('note.save');
     }
     if (!$checkedOut && count(User::getAuthorisedCategories('com_users', 'core.create'))) {
         Toolbar::save2new('note.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && count(User::getAuthorisedCategories('com_users', 'core.create')) > 0) {
         Toolbar::save2copy('note.save2copy');
     }
     if (empty($this->item->id)) {
         Toolbar::cancel('note.cancel');
     } else {
         Toolbar::cancel('note.cancel', 'JTOOLBAR_CLOSE');
     }
     Toolbar::divider();
     Toolbar::help('note');
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:34,代码来源:view.html.php

示例4: test_returnAllOnNullName

 /**
  * Test that the collection returns all on a NULL name
  *
  * @return void
  * @author Dan Cox
  */
 public function test_returnAllOnNullName()
 {
     $collections = $this->collection->get();
     $this->assertTrue(array_key_exists('question', $collections));
     $this->assertTrue(array_key_exists('comment', $collections));
     $this->assertTrue(array_key_exists('error', $collections));
 }
开发者ID:danzabar,项目名称:phalcon-cli,代码行数:13,代码来源:CollectionTest.php

示例5: get

 /**
  * Returns a service, if a mock is specified for it, it will return the mock instead
  *
  * @return Object
  * @author Dan Cox
  */
 public static function get($service)
 {
     if (array_key_exists($service, static::$mocks)) {
         return static::$mocks[$service];
     }
     return static::$container->get($service);
 }
开发者ID:danzabar,项目名称:alice,代码行数:13,代码来源:DI.php

示例6: read

 /**
  * @see	\herosphp\session\interfaces\ISession::read().
  */
 public static function read($sessionId)
 {
     if (self::$handler == NULL) {
         return '';
     }
     $data = self::$handler->get($sessionId);
     return $data;
 }
开发者ID:yangjian102621,项目名称:herosphp,代码行数:11,代码来源:RedisSession.class.php

示例7: __construct

 /**
  * Set up the helper class
  *
  * @return void
  */
 public function __construct($di = null)
 {
     if (!is_null($di)) {
         $this->di = $di;
         $this->output = $this->di->get('output');
         $this->input = $this->di->get('input');
     }
 }
开发者ID:danzabar,项目名称:phalcon-cli,代码行数:13,代码来源:Helper.php

示例8: read

 /**
  * 获得缓存数据
  * @param string $sid
  * @return void
  */
 function read($sid)
 {
     $m_data = $this->memcache->get($sid);
     if (!isset($m_data['card'])) {
         return array();
     }
     return $m_data['card'] === $this->card ? $m_data['Data'] : array();
 }
开发者ID:sxau-web-team,项目名称:wish-web,代码行数:13,代码来源:SessionMemcache.class.php

示例9: test_compileAndRegister

 /**
  * Register the compiler pass and compile the DI
  *
  * @return void
  * @author Dan Cox
  */
 public function test_compileAndRegister()
 {
     $mock = new ServiceMockery('service');
     $mock->add();
     $this->DI->addCompilerPass(new MockeryPass());
     $this->DI->compile();
     $this->DI->get('service')->shouldReceive('test')->andReturn(true);
     $this->assertTrue($this->DI->get('service')->test());
 }
开发者ID:antoligy,项目名称:Framework,代码行数:15,代码来源:MockeryPassTest.php

示例10: read

 /**
  * 获得缓存数据
  * @param string $sid
  * @return void
  */
 function read($sid)
 {
     $data = $this->redis->get($sid);
     if ($data) {
         $values = explode("|#|", $data);
         return $values[0] === $this->card ? $values[1] : '';
     }
     return $data;
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:14,代码来源:Redis.php

示例11: test_replacementOfMaskValue

 /**
  * Test that when loading an existing mask, it overwrites current values
  *
  * @return void
  * @author Dan Cox
  */
 public function test_replacementOfMaskValue()
 {
     // Add a single mask
     $this->masks->addMask('test', 'value');
     // Replace this by adding a single mask with the same name
     $this->masks->addMask('test', 'different');
     $this->assertEquals('different', $this->masks->get('test'));
     // Replace this again by adding an array
     $this->masks->addMasks(array('test' => 'foo'));
     $this->assertEquals('foo', $this->masks->get('test'));
 }
开发者ID:danzabar,项目名称:alice,代码行数:17,代码来源:MasksTest.php

示例12: get

 /**
  * 获取数据
  * 
  * @param String $key 键值
  * @return Mixed
  */
 public function get($key)
 {
     $val = $this->mObject->get($key);
     $unserialize_val = unserialize($val);
     if (is_array($unserialize_val)) {
         return $unserialize_val;
     } else {
         return $val;
     }
     return $val;
 }
开发者ID:GStepOne,项目名称:CI,代码行数:17,代码来源:class.tt.php

示例13: format

 /**
  * Checks a string for format codes and replaces it with its background/foreground color codes
  *
  * @return String
  */
 public static function format($str)
 {
     preg_match('/<[A-Za-z0-9]+?>/', $str, $matches);
     foreach ($matches as $match) {
         $keyword = str_replace(array('<', '>'), '', $match);
         $format = static::$collection->get(strtolower($keyword));
         if (!empty($format)) {
             $foreground = !isset($format['foreground']) ? '' : "[" . $format['foreground'] . "m";
             $background = !isset($format['background']) ? '' : "[" . $format['background'] . "m";
             $str = str_replace(array('<' . $keyword . '>', '</' . $keyword . '>'), array($foreground . $background, "[0m"), $str);
         }
     }
     return $str;
 }
开发者ID:danzabar,项目名称:phalcon-cli,代码行数:19,代码来源:Format.php

示例14: get_tmp_dir_path

 /**
  * 從MD5取得檔案路徑
  * 
  * @param Object $f3
  * @param String $md5
  * @return string
  * @author Pulipuli Chen <pulipuli.chen@gmail.com>
  * @version 20140908
  */
 public static function get_tmp_dir_path($f3, $md5)
 {
     $path1 = substr($md5, 0, 2);
     $path2 = substr($md5, 2, 2);
     if ($f3->get("DEBUG.use_sys_tmp") === TRUE) {
         $file_dir = sys_get_temp_dir() . "/";
     } else {
         $file_dir = $f3->get("UPLOADS") . "tmp/";
     }
     $file_dir .= "PFH/" . $path1 . "/" . $path2 . "/";
     if (is_dir($file_dir) === FALSE) {
         mkdir($file_dir, 0700, true);
     }
     return $file_dir;
 }
开发者ID:rivalinx,项目名称:php-file-host,代码行数:24,代码来源:PFH_MD5.php

示例15: get

 /**
  * 获得缓存数据
  * @access public
  * @param string $name  缓存KEY
  * @return boolean
  */
 public function get($name, $ctime = null)
 {
     //缓存KEY
     $name = $this->options['prefix'] . $name;
     $data = $this->memcacheObj->get($name);
     return $data !== false ? $data : NULL;
 }
开发者ID:www2511550,项目名称:ECSHOP,代码行数:13,代码来源:CacheMemcache.class.php


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