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


PHP ContentController::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     if (!$this->config()->service) {
         $this->httpError(404);
     }
     $this->setService($this->config()->service);
     $this->pageService = new StyleGuide\PageService($this);
     // redirect to the first action route
     if (!$this->request->param('Action')) {
         $page = $this->pageService->getPages()->first();
         $this->redirect($page->Link);
     }
     // if no template set on the action route then redirect to the first child
     if (!$this->request->param('ChildAction') && !$this->pageService->getTemplate()) {
         $page = $this->pageService->getActivePage();
         if (isset($page->Children)) {
             $childPage = $page->Children->first();
             $this->redirect($childPage->Link);
         }
     }
     // set the service
     $this->setRequirements();
     // load the fixture file
     $this->loadFixture();
 }
开发者ID:benmanu,项目名称:silverstripe-styleguide,代码行数:26,代码来源:StyleGuideController.php

示例2: init

 public function init()
 {
     parent::init();
     // Import jquery and bootstrap js
     Requirements::javascript($this->ThemeDir() . "/js/libs/jquery.min.js");
     Requirements::javascript($this->ThemeDir() . "/js/libs/bootstrap.min.js");
 }
开发者ID:robb-j,项目名称:ss-boilerplate,代码行数:7,代码来源:Page.php

示例3: init

 public function init()
 {
     parent::init();
     // Note: you should use SS template require tags inside your templates
     // instead of putting Requirements calls here.  However these are
     // included so that our older themes still work
     Requirements::themedCSS('layout');
     Requirements::themedCSS('comments');
     Requirements::themedCSS('typography');
     Requirements::themedCSS('form');
     Requirements::themedCSS('slick');
     if (!Cookie::get($StoryModeCookie)) {
         Cookie::set($StoryModeCookie, 'Normal');
     }
     if (!Cookie::get($StorySizeCookie)) {
         Cookie::set($StorySizeCookie, 'Normal');
     }
     // Increment page view counter
     $pagecounter = DataObject::get_one("PageCounter", "PageID='{$this->ID}'");
     if (!$pagecounter) {
         $pagecounter = new PageCounter();
         $pagecounter->PageID = $this->ID;
     }
     $pagecounter->Counter = $pagecounter->Counter + 1;
     $pagecounter->write();
 }
开发者ID:krissihall,项目名称:sm_ss,代码行数:26,代码来源:Page.php

示例4: init

    public function init()
    {
        parent::init();
        Requirements::themedCSS('reset');
        Requirements::themedCSS('layout');
        Requirements::themedCSS('form');
        Requirements::themedCSS('typography');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::css('mysite/css/demo.css');
        Requirements::css('mysite/css/moduleSupport.css');
        Requirements::customScript(<<<JS
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-84547-17', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', [
\t'www.silverstripe.com',
\t'www.silverstripe.org',
\t'addons.silverstripe.org',
\t'api.silverstripe.org',
\t'docs.silverstripe.org',
\t'userhelp.silverstripe.org',
\t'demo.silverstripe.org'
]);
ga('send', 'pageview');
JS
);
    }
开发者ID:mateusz,项目名称:demo.silverstripe.org,代码行数:31,代码来源:Page.php

示例5: init

 public function init()
 {
     parent::init();
     // Note: you should use SS template require tags inside your templates
     // instead of putting Requirements calls here.  However these are
     // included so that our older themes still work
     Requirements::css('themes/simple/css/homepage.css');
     Requirements::customScript('
             $("a.scroll-arrow").mousedown( function(e) {
                          e.preventDefault();              
           			var container = $(this).parent().attr("id");                              
                            var direction = $(this).is("#scroll-right") ? "+=" : "-=";
                            var totalWidth = -$(".row__inner").width();
                            $(".row__inner .tile").each(function() {
                                totalWidth += $(this).outerWidth(true);
                            });
                            
                            $("#"+ container + " .row__inner").animate({
                                scrollLeft: direction + Math.min(totalWidth, 3000)
                                
                            },{
                                duration: 2500,
                                easing: "swing", 
                                queue: false }
                            );
                        }).mouseup(function(e) {
                          $(".row__inner").stop();
            });');
 }
开发者ID:jareddreyer,项目名称:catalogue,代码行数:29,代码来源:Page.php

示例6: init

 public function init()
 {
     parent::init();
     // Note: you should use SS template require tags inside your templates
     // instead of putting Requirements calls here.  However these are
     // included so that our older themes still work
 }
开发者ID:nicmart,项目名称:comperio-site,代码行数:7,代码来源:Page.php

示例7: init

 public function init()
 {
     parent::init();
     // You can include any CSS or JS required by your project here.
     // See: http://doc.silverstripe.org/framework/en/reference/requirements
     Requirements::css("https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");
 }
开发者ID:andrewandante,项目名称:blackdorisrovers,代码行数:7,代码来源:Page.php

示例8: init

    public function init()
    {
        parent::init();
        // Concatenate CSS
        Requirements::combine_files('style.css', array('mysite/css/layout.css', 'mysite/css/userstyles.css'));
        // Concatenate JavaScript
        Requirements::combine_files('scripts.js', array('mysite/javascript/lib/top-nav.js', 'mysite/javascript/vanilla.js'));
        // Google Analytics
        $config = SiteConfig::current_site_config();
        $google = $config->GACode;
        $gaJS = <<<JS
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o), m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
            ga('create', '{$google}', 'auto');
            ga('send', 'pageview');
JS;
        Requirements::customScript($gaJS);
    }
开发者ID:digi-brains,项目名称:Silver-Stream,代码行数:26,代码来源:Page.php

示例9: init

    public function init()
    {
        parent::init();
        Requirements::themedCSS('reset');
        Requirements::themedCSS('layout');
        Requirements::themedCSS('form');
        Requirements::themedCSS('typography');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::css('mysite/css/demo.css');
        Requirements::css('mysite/css/moduleSupport.css');
        Requirements::customScript(<<<JS
var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-84547-11']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
JS
);
    }
开发者ID:newleeland,项目名称:demo.silverstripe.org,代码行数:26,代码来源:Page.php

示例10: init

	function init() {
		parent::init();
		
		Requirements::themedCSS("layout");
		Requirements::themedCSS("typography");
		Requirements::themedCSS("form");
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:7,代码来源:Page.php

示例11: init

 public function init()
 {
     parent::init();
     $this->loadCSS();
     $this->loadFonts();
     $this->customJQueryScripts();
     $this->loadJS();
 }
开发者ID:stephenjcorwin,项目名称:silverstripe-demo,代码行数:8,代码来源:Page.php

示例12: init

 public function init()
 {
     parent::init();
     Requirements::javascript("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js");
     Requirements::javascript("pocket-watch/js/bootstrap.min.js");
     Requirements::javascript("pocket-watch/js/jquery.mixitup.min.js");
     Requirements::javascript("pocket-watch/js/call.mixitup.js");
 }
开发者ID:PsukheDelos,项目名称:pocketwatch,代码行数:8,代码来源:Gallery.php

示例13: init

 public function init()
 {
     parent::init();
     Requirements::block('bootstrap-forms/css/bootstrap.css');
     Requirements::block('bootstrap-forms/javascript/bootstrap_forms.js');
     Requirements::block('framework/thirdparty/jquery/jquery.js');
     Requirements::block('userforms/css/UserForm.css');
 }
开发者ID:jbennecker,项目名称:silverstripe-boilerplate,代码行数:8,代码来源:Page.php

示例14: init

 function init()
 {
     parent::init();
     Requirements::themedCSS("layout");
     Requirements::themedCSS("typography");
     Requirements::themedCSS("form");
     Requirements::javascript('mysite/javascript/extjs.js');
     Requirements::javascript('themes/belmarkhomes/javascript/Page.js');
 }
开发者ID:ramziammar,项目名称:websites,代码行数:9,代码来源:Page.php

示例15: init

	public function init() {
		parent::init();

		// Note: you should use <% require %> tags inside your templates instead of putting Requirements calls here.  However
		// these are included so that our older themes still work
		Requirements::themedCSS("layout"); 
		Requirements::themedCSS("typography"); 
		Requirements::themedCSS("form"); 
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:9,代码来源:Page.php


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