示例#1
0
文件: LaraForm.php 项目: larakit/lk
 function getValidatorClass()
 {
     $class = Event::filter('validator::' . get_called_class(), $this->validator_class);
     if (!is_a($class, \Larakit\ValidateBuilder::class, true)) {
         return null;
     }
     return $class;
 }
示例#2
0
文件: Controller.php 项目: larakit/lk
 function response($vars = [])
 {
     if (!isset($vars['base_url'])) {
         $vars['base_url'] = $this->base_url;
     }
     Event::notify('lk-page::before_layout');
     $layout = \View::make($this->getLayout(), $vars);
     Event::notify('lk-page::before_page', $layout);
     return \LaraPage::setContent($layout);
 }
示例#3
0
文件: Page.php 项目: larakit/lk
 public function pageDescriptionValues()
 {
     static $values;
     if (!isset($values)) {
         $values = Event::filter('lk-page::description', (array) trans('page.description'));
     }
     return $values;
 }
示例#4
0
                if ($size) {
                    $link->setAttribute('sizes', $size . 'x' . $size);
                }
                $parameters[] = $link;
            }
        }
    }
    return $parameters;
});
/**
 * Viewport
 */
\Larakit\Event\Event::listener('lk-page::meta-tags', function (sfEvent $e, $parameters) {
    $viewport = LaraPage::getViewport();
    if ($viewport) {
        $parameters[] = '<!-- Viewport -->';
        $parameters[] = HtmlMeta::setName('viewport')->setContent($viewport);
    }
    return $parameters;
});
/**
 * Generator
 */
\Larakit\Event\Event::listener('lk-page::meta-tags', function (sfEvent $e, $parameters) {
    $generator = LaraPage::getGenerator();
    if ($generator) {
        $parameters[] = '<!-- Generator -->';
        $parameters[] = HtmlMeta::setName('generator')->setContent($generator);
    }
    return $parameters;
});