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


PHP Registry::def方法代码示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param   Registry  $options  JOpenstreetmapOauth options object.
  * @param   JHttp     $client   The HTTP client object.
  * @param   JInput    $input    The input object
  *
  * @since   13.1
  */
 public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null)
 {
     $this->options = isset($options) ? $options : new Registry();
     $this->options->def('accessTokenURL', 'http://www.openstreetmap.org/oauth/access_token');
     $this->options->def('authoriseURL', 'http://www.openstreetmap.org/oauth/authorize');
     $this->options->def('requestTokenURL', 'http://www.openstreetmap.org/oauth/request_token');
     /*
     $this->options->def('accessTokenURL', 'http://api06.dev.openstreetmap.org/oauth/access_token');
     $this->options->def('authoriseURL', 'http://api06.dev.openstreetmap.org/oauth/authorize');
     $this->options->def('requestTokenURL', 'http://api06.dev.openstreetmap.org/oauth/request_token');
     */
     // Call the JOauth1Client constructor to setup the object.
     parent::__construct($this->options, $client, $input, null, '1.0');
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:23,代码来源:oauth.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param   Registry     $options  Google options object
  * @param   JGoogleAuth  $auth     Google data http client object
  *
  * @since   12.3
  */
 public function __construct(Registry $options = null, JGoogleAuth $auth = null)
 {
     // Setup the default API url if not already set.
     $options->def('api.url', 'https://www.googleapis.com/plus/v1/');
     parent::__construct($options, $auth);
     if (isset($this->auth) && !$this->auth->getOption('scope')) {
         $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me');
     }
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:17,代码来源:plus.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param   JOpenstreetmapOauth  $oauth    Openstreetmap oauth client
  * @param   Registry             $options  Openstreetmap options object
  * @param   JHttp                $client   The HTTP client object
  *
  * @since   13.1
  */
 public function __construct(JOpenstreetmapOauth $oauth = null, Registry $options = null, JHttp $client = null)
 {
     $this->oauth = $oauth;
     $this->options = isset($options) ? $options : new Registry();
     $this->client = isset($client) ? $client : new JHttp($this->options);
     // Setup the default API url if not already set.
     $this->options->def('api.url', 'http://api.openstreetmap.org/api/0.6/');
     // $this->options->def('api.url', 'http://api06.dev.openstreetmap.org/api/0.6/');
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:18,代码来源:openstreetmap.php

示例4: prepareDocument

	/**
	 * Prepares the document
	 *
	 * @return void
	 *
	 * @since       1.7.2
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->def('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_CHURCHDIRECTORY_DEFAULT_PAGE_TITLE'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetaData('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetaData('robots', $this->params->get('robots'));
		}
	}
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:58,代码来源:view.html.php

示例5: defParam

 /**
  * Method to set a default parameter if it does not exist
  *
  * @param   string  $key    Parameter key
  * @param   mixed   $value  Parameter value
  *
  * @return  mixed  Set parameter value
  *
  * @since   11.1
  */
 public function defParam($key, $value)
 {
     return $this->_params->def($key, $value);
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:14,代码来源:user.php

示例6: testDef

 /**
  * Test the Joomla\Registry\Registry::def method.
  *
  * @return  void
  *
  * @covers  Joomla\Registry\Registry::def
  * @since   1.0
  */
 public function testDef()
 {
     $a = new Registry();
     $this->assertThat($a->def('foo', 'bar'), $this->equalTo('bar'), 'Line: ' . __LINE__ . '. def should return default value');
     $this->assertThat($a->get('foo'), $this->equalTo('bar'), 'Line: ' . __LINE__ . '. default should now be the current value');
 }
开发者ID:ZerGabriel,项目名称:joomla-framework,代码行数:14,代码来源:RegistryTest.php

示例7: testDoNotDefineADefaultValueIfKeyIsSet

 /**
  * @testdox  A default value is not assigned to a key if already set
  *
  * @covers   Joomla\Registry\Registry::def
  */
 public function testDoNotDefineADefaultValueIfKeyIsSet()
 {
     $a = new Registry(array('foo' => 'bar'));
     $this->assertSame($a->def('foo', 'car'), 'bar', 'Calling def() on a key with a value should return the current value.');
 }
开发者ID:nkuitche,项目名称:registry,代码行数:10,代码来源:RegistryTest.php


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