本文整理汇总了PHP中Redaxscript\Registry::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::get方法的具体用法?PHP Registry::get怎么用?PHP Registry::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redaxscript\Registry
的用法示例。
在下文中一共展示了Registry::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: contentFragmentEnd
/**
* contentFragmentEnd
*
* @since 3.0.0
*/
public static function contentFragmentEnd()
{
if (Registry::get('lastTable') === 'articles') {
$url = Registry::get('root') . Registry::get('parameterRoute') . Registry::get('fullRoute');
return self::render($url);
}
}
示例2: renderStart
/**
* renderStart
*
* @since 3.0.0
*/
public static function renderStart()
{
if (Registry::get('loggedIn') !== Registry::get('token')) {
$script = Head\Script::getInstance();
$script->init('foot')->appendFile('//google-analytics.com/analytics.js')->appendFile('modules/Analytics/assets/scripts/init.js')->appendFile('modules/Analytics/assets/scripts/analytics.js');
}
}
示例3: renderStart
/**
* renderStart
*
* @since 3.0.0
*/
public static function renderStart()
{
if (Registry::get('loggedIn') !== Registry::get('token')) {
$script = Head\Script::getInstance();
$script->init('foot')->appendFile('//google-analytics.com/cx/api.js?experiment=' . self::$_configArray['id'])->appendFile('modules/Experiments/assets/scripts/init.js')->appendFile('modules/Experiments/assets/scripts/experiments.js');
}
}
示例4: render
/**
* render
*
* @since 2.2.0
*
* @param mixed $src
* @param array $options
*
* @return string
*/
public static function render($src = null, $options = array())
{
$output = null;
/* device related images */
if (is_array($src)) {
/* process source */
foreach ($src as $key => $value) {
if (in_array($key, self::$_config['device']) && Registry::get('my' . ucfirst($key))) {
$src = $value;
}
}
}
/* collect output */
if (file_exists($src)) {
$imageElement = new Html\Element();
$imageElement->init('img', array('alt' => $options['alt'], 'class' => self::$_config['className']['image'] . ' ' . $options['className'], 'src' => self::$_config['placeholder']));
/* collect output */
$output = $imageElement->copy()->attr('data-src', $src);
/* placeholder */
if (self::$_config['placeholder']) {
/* calculate image ratio */
$imageDimensions = getimagesize($src);
$imageRatio = $imageDimensions[1] / $imageDimensions[0] * 100;
/* placeholder */
$placeholderElement = new Html\Element();
$placeholderElement->init('div', array('class' => self::$_config['className']['placeholder'], 'style' => 'padding-bottom:' . $imageRatio . '%'));
/* collect output */
$output = $placeholderElement->html($output);
}
/* noscript fallback */
$output .= '<noscript>' . $imageElement . '</noscript>';
}
return $output;
}
示例5: scriptStart
/**
* scriptStart
*
* @since 2.2.0
*/
public static function scriptStart()
{
if (Registry::get('loggedIn') !== Registry::get('token')) {
$output = '<script src="//google-analytics.com/ga.js"></script>';
echo $output;
}
}
示例6: scriptsStart
/**
* scriptsStart
*
* @since 2.2.0
*/
public static function scriptsStart()
{
if (Registry::get('loggedIn') === Registry::get('token') && Registry::get('firstParameter') === 'admin') {
$output = '<script src="//google-analytics.com/ga.js"></script>';
echo $output;
}
}
示例7: _writeXML
/**
* @param object $categories
* @param object $articles
*
* @return string
*/
protected static function _writeXML($categories = null, $articles = null)
{
$writer = new XMLWriter();
$writer->openMemory();
$writer->setIndent(true);
$writer->setIndentString(' ');
$writer->startDocument('1.0', Db::getSetting('charset'));
$writer->startElement('urlset');
$writer->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root'));
$writer->endElement();
/* process categories */
foreach ($categories as $value) {
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root') . Registry::get('parameterRoute') . build_route('categories', $value->id));
$writer->writeElement('lastmod', date('c', strtotime($value->date)));
$writer->endElement();
}
/* process articles */
foreach ($articles as $value) {
$writer->startElement('url');
$writer->writeElement('loc', Registry::get('root') . Registry::get('parameterRoute') . build_route('articles', $value->id));
$writer->writeElement('lastmod', date('c', strtotime($value->date)));
$writer->endElement();
}
$writer->endElement();
$writer->endDocument();
return $writer->outputMemory(true);
}
示例8: centerStart
/**
* centerStart
*
* @since 2.2.0
*/
public static function centerStart()
{
if (Registry::get('firstParameter') === 'qunit') {
$output = '<div id="qunit" class="wrapper_qunit"></div><div id="qunit-fixture"></div>';
echo $output;
}
}
示例9: renderStart
/**
* renderStart
*
* @since 3.0.0
*/
public static function renderStart()
{
if (Registry::get('loggedIn') === Registry::get('token') && Registry::get('firstParameter') === 'admin') {
$script = Head\Script::getInstance();
$script->init('foot')->appendFile('//google-analytics.com/analytics.js')->appendFile('modules/CallHome/assets/scripts/init.js')->appendFile('modules/CallHome/assets/scripts/call_home.js');
}
}
示例10: scriptEnd
/**
* scriptEnd
*
* @since 2.6.0
*/
public static function scriptEnd()
{
if (Registry::get('loggedIn') === Registry::get('token')) {
$output = '<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>';
echo $output;
}
}
示例11: renderStart
/**
* renderStart
*
* @since 3.0.0
*/
public static function renderStart()
{
if (Registry::get('firstParameter') === 'tinymce' && Registry::get('secondParameter') === 'upload' && Registry::get('lastParameter') === Registry::get('token')) {
Registry::set('renderBreak', true);
echo self::_upload();
}
}
示例12: scriptsEnd
/**
* scriptsEnd
*
* @since 2.2.0
*/
public static function scriptsEnd()
{
if (!Registry::get('adminParameter')) {
$output = '<script src="' . self::$_config['apiUrl'] . '?key=' . self::$_config['apiKey'] . '&sensor=' . self::$_config['sensor'] . '"></script>';
echo $output;
}
}
示例13: articleEnd
/**
* articleEnd
*
* @since 2.2.0
*/
public static function articleEnd()
{
if (Registry::get('lastTable') === 'articles') {
$url = Registry::get('root') . '/' . Registry::get('rewriteRoute') . Registry::get('fullRoute');
$output = self::render($url);
return $output;
}
}
示例14: renderStart
/**
* renderStart
*
* @since 2.2.0
*/
public static function renderStart()
{
if (Registry::get('firstParameter') === 'manifest_webapp') {
Registry::set('renderBreak', true);
header('content-type: application/x-web-app-manifest+json');
include_once 'modules/WebApp/files/manifest.json';
}
}
示例15: renderStart
/**
* renderStart
*
* @since 2.2.0
*/
public static function renderStart()
{
if (Registry::get('articleId')) {
Registry::set('commentReplace', true);
/* script */
$script = Head\Script::getInstance();
$script->init('foot')->appendFile(self::$_configArray['url'])->appendFile('modules/Disqus/assets/scripts/init.js');
}
}