本文整理汇总了PHP中Setting::getString方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getString方法的具体用法?PHP Setting::getString怎么用?PHP Setting::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the component
*/
public function init()
{
$this->_checker = new Whitelist\Check();
// Load any stored definitions
$definitions = Setting::getString('whitelist');
if (!empty($definitions)) {
$definitions = $this->parseDefinitions($definitions);
$this->setDefinitions($definitions);
}
parent::init();
}
示例2: init
/**
* Initializes the controller. The application name and language is set here.
*/
public function init()
{
// Fallback to XBMC Video Server if the user has removed the
// application name
$name = Setting::getString('applicationName');
if (!$name) {
$name = 'XBMC Video Server';
}
Yii::app()->name = $name;
Yii::app()->language = Yii::app()->languageManager->getCurrent();
parent::init();
}
示例3: init
/**
* Initializes the component. The application language is set here. The
* language selected is the one the user has specified, if not the
* configured application language (which defaults to en).
*/
public function init()
{
$applicationLanguage = Setting::getString('language');
$sessionLanguage = Yii::app()->session->get(self::SESSION_KEY);
$userLanguage = $this->getUserLanguage();
if ($sessionLanguage) {
$this->_currentLanguage = $sessionLanguage;
} elseif ($userLanguage) {
$this->_currentLanguage = $userLanguage;
} else {
$this->_currentLanguage = $applicationLanguage;
}
parent::init();
}
示例4: init
/**
* Initializes the controller. The application name and language is set here.
*/
public function init()
{
// Use the defined request timeout as execution time limit
$requestTimeout = Setting::getInteger('requestTimeout');
set_time_limit($requestTimeout);
// Fallback to XBMC Video Server if the user has removed the
// application name
$name = Setting::getString('applicationName');
if (!$name) {
$name = 'XBMC Video Server';
}
Yii::app()->name = $name;
Yii::app()->language = Yii::app()->languageManager->getCurrent();
parent::init();
}
示例5: create
/**
* Factory method for creating playlist objects
* @param string $fileName
* @param string $format the desired playlist format. Defaults to null,
* meaning the configured default format will be used
* @return Playlist the playlist object
* @throws InvalidRequestException if the playlist format is not supported
*/
public static function create($fileName, $format = null)
{
if ($format === null) {
$format = Setting::getString('playlistFormat');
}
switch ($format) {
case Playlist::TYPE_M3U:
return new M3UPlaylist($fileName);
case Playlist::TYPE_XSPF:
return new XSPFPlaylist($fileName);
case Playlist::TYPE_PLS:
return new PLSPlaylist($fileName);
default:
throw new InvalidRequestException();
}
}
示例6: renderWatchButton
/**
* Renders the "Watch as playlist" button
*/
private function renderWatchButton()
{
// Select the default playlist format by default
$dropdownOptions = array(Setting::getString('playlistFormat') => array('selected' => 'selected'));
echo TbHtml::dropDownListControlGroup('playlistFormat', 'playlistFormat', PlaylistFactory::getTypes(), array('label' => Yii::t('Settings', 'Playlist format'), 'options' => $dropdownOptions));
echo TbHtml::submitButton(Yii::t('RetrieveMediaWidget', 'Watch as playlist'), $this->getWatchButtonsOptions());
}
示例7: array
<?php
$name = Setting::getString('applicationName');
$subtitle = Setting::getString('applicationSubtitle');
?>
<div class="row-fluid">
<div class="span12 header">
<?php
if ($name) {
?>
<h1 id="home-url">
<a href="<?php
echo Yii::app()->homeUrl;
?>
">
<?php
echo $name;
?>
</a>
</h1>
<?php
}
if ($subtitle) {
echo CHtml::tag('p', array('class' => 'lead'), $subtitle);
}
?>
</div>
</div>