Exemplo n.º 1
0
 public function testUsingFacade()
 {
     Shortcode::register('foo', function () {
         return 'bar';
     });
     $this->assertEquals('foo', Shortcode::compile('foo'));
 }
Exemplo n.º 2
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     setlocale(LC_ALL, 'ru_RU.UTF-8');
     Carbon::setLocale(config('app.locale'));
     \Shortcode::register('slider', '\\App\\Shortcode\\Slider');
     \Shortcode::register('section', '\\App\\Shortcode\\Section');
     \Shortcode::register('iframe', '\\App\\Shortcode\\Iframe');
     \Shortcode::register('timeline', '\\App\\Shortcode\\Timeline');
     if (\DB::getDoctrineSchemaManager()->tablesExist('options')) {
         Option::observe(new OptionObserver());
         if (Option::has('vk-user-token')) {
             Vk::setAccessToken(Option::get('vk-user-token'));
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Initiate shortcode.
  */
 public function init()
 {
     $name = get_class($this);
     $sc = str_replace('shortcode', '', strtolower($name));
     Shortcode::register($sc, array(&$this, 'render'));
 }