Exemplo n.º 1
0
 public function getFunctions()
 {
     return ['links' => function ($cat, $lang, $parent_nav_id) {
         return \yii::$app->links->findByArguments(['cat' => $cat, 'lang' => $lang, 'parent_nav_id' => (int) $parent_nav_id]);
     }, 'linksFindParent' => function ($level) {
         return \luya\helpers\Menu::parentNavIdByCurrentLink(\yii::$app->links, $level);
     }, 'linkActivePart' => function ($part) {
         return \yii::$app->links->getActiveUrlPart($part);
     }, 'asset' => function ($name) {
         return \yii::$app->getAssetManager()->getBundle($name);
     }, 'filterApply' => function ($imageId, $filterIdentifier) {
         return \yii::$app->storage->image->filterApply($imageId, $filterIdentifier);
     }, 'image' => function ($imageId) {
         return \yii::$app->storage->image->get($imageId);
     }];
 }
Exemplo n.º 2
0
<?php

$composition = yii::$app->composition;
$links = \yii::$app->links;
$first = \luya\helpers\Menu::parentNavIdByCurrentLink($links, 1);
$second = \luya\helpers\Menu::parentNavIdByCurrentLink($links, 2);
$third = \luya\helpers\Menu::parentNavIdByCurrentLink($links, 3);
?>
<html>
    <head>
        <title>Luya-Demo-Webseite // <?php 
echo $this->context->pageTitle;
?>
</title>
        <base href="<?php 
echo \yii\helpers\Url::base(true);
?>
/" />
        <?php 
$this->head();
?>
    </head>
    <body>
    <?php 
$this->beginBody();
?>
    
    
        <div class="container">
            <div id="teaser">LUYA