Example #1
0
 public function testUsingFacade()
 {
     Shortcode::register('foo', function () {
         return 'bar';
     });
     $this->assertEquals('foo', Shortcode::compile('foo'));
 }
Example #2
0
 public function register($attr, $content = null, $name = null)
 {
     $content = \Shortcode::compile($content);
     $attr['class'] = 'section ' . str_replace('"', '', isset($attr['class']) ? $attr['class'] : '');
     $hr = isset($attr['hr']) ? $attr['hr'] : null;
     if ($hr) {
         unset($attr['hr']);
         $content .= '<hr class="half-rule">';
     }
     return '<div ' . \Html::attributes($attr) . '>' . $content . '</div>';
 }