public function renderToolbar($event)
    {
        Yii::info('LUYA CMS Toolbar rendering start', __METHOD__);
    
        $props = [];
        foreach (Yii::$app->menu->current->model->properties as $prop) {
            $o = $prop->getObject();
            $props[] = ['label' => $o->label(), 'value' => $o->getValue()];
        }
    
        $menu = Yii::$app->menu;
    
        // seo keyword frequency
        $seoAlert = 0;
        $keywords = [];
        $content = strip_tags($event->data['content']);
    
        if (empty($menu->current->description)) {
            $seoAlert++;
        }
    
        if (empty($menu->current->keywords)) {
            $seoAlert++;
        } else {
            foreach ($menu->current->keywords as $word) {
                if (preg_match_all('/' . preg_quote($word, '/') . '/i', $content, $matches)) {
                    $keywords[] = [$word, count($matches[0])];
                } else {
                    $keywords[] = [$word, 0];
                    $seoAlert++;
                }
            }
        }
        
        // As the view path can not evaluated from controller context, we have to force the viewPath trough
        // the module instance.
        // @see https://github.com/luyadev/luya/issues/1768
        $viewSourcePath = Module::getInstance()->viewPath;
        
        // echo is used in order to support cases where asset manager is not available
        echo '<style>' . $this->view->renderFile($viewSourcePath . '/inline/toolbar.css') . '</style>';
        // mabye ensure that jquery is loaded,  better put this at the End of body tag
        echo '<script>' . $this->view->renderFile($viewSourcePath . '/inline/toolbar.js') . '</script>';
    
        echo $this->view->renderFile($viewSourcePath . '/_toolbar.php', [
            'keywords' => $keywords,
            'seoAlertCount' => $seoAlert,
            'menu' => $menu,
            'composition' => Yii::$app->composition,
            'luyaTagParsing' => $event->sender->context->module->enableTagParsing,
            'properties' => $props,
            'content' => $content,
        ]);
    
        Yii::info('LUYA CMS Toolbar rendering is finished', __METHOD__);
    }
public function renderToolbar($event)
    {
        Yii::info('LUYA CMS Toolbar rendering start', __METHOD__);
    
        $props = [];
        foreach (Yii::$app->menu->current->model->properties as $prop) {
            $o = $prop->getObject();
            $props[] = ['label' => $o->label(), 'value' => $o->getValue()];
        }
    
        $menu = Yii::$app->menu;
    
        // seo keyword frequency
        $seoAlert = 0;
        $keywords = [];
        $content = strip_tags($event->data['content']);
    
        if (empty($menu->current->description)) {
            $seoAlert++;
        }
    
        if (empty($menu->current->keywords)) {
            $seoAlert++;
        } else {
            foreach ($menu->current->keywords as $word) {
                if (preg_match_all('/' . preg_quote($word, '/') . '/i', $content, $matches)) {
                    $keywords[] = [$word, count($matches[0])];
                } else {
                    $keywords[] = [$word, 0];
                    $seoAlert++;
                }
            }
        }
        
        // As the view path can not evaluated from controller context, we have to force the viewPath trough
        // the module instance.
        // @see https://github.com/luyadev/luya/issues/1768
        $viewSourcePath = Module::getInstance()->viewPath;
        
        // echo is used in order to support cases where asset manager is not available
        echo '<style>' . $this->view->renderFile($viewSourcePath . '/inline/toolbar.css') . '</style>';
        // mabye ensure that jquery is loaded,  better put this at the End of body tag
        echo '<script>' . $this->view->renderFile($viewSourcePath . '/inline/toolbar.js') . '</script>';
    
        echo $this->view->renderFile($viewSourcePath . '/_toolbar.php', [
            'keywords' => $keywords,
            'seoAlertCount' => $seoAlert,
            'menu' => $menu,
            'composition' => Yii::$app->composition,
            'luyaTagParsing' => $event->sender->context->module->enableTagParsing,
            'properties' => $props,
            'content' => $content,
        ]);
    
        Yii::info('LUYA CMS Toolbar rendering is finished', __METHOD__);
    }
public function renderToolbar ( $ event ) { Yii :: info ( 'LUYA CMS Toolbar rendering start' , __METHOD__ ) ; $ props = [ ] ; foreach ( Yii :: $ app -> menu -> current -> model -> properties as $ prop ) { $ o = $ prop -> getObject ( ) ; $ props [ ] = [ 'label' => $ o -> label ( ) , 'value' => $ o -> getValue ( ) ] ; } $ menu = Yii :: $ app -> menu ; // seo keyword frequency $ seoAlert = 0 ; $ keywords = [ ] ; $ content = strip_tags ( $ event -> data [ 'content' ] ) ; if ( empty ( $ menu -> current -> description ) ) { $ seoAlert ++ ; } if ( empty ( $ menu -> current -> keywords ) ) { $ seoAlert ++ ; } else { foreach ( $ menu -> current -> keywords as $ word ) { if ( preg_match_all ( '/' . preg_quote ( $ word , '/' ) . '/i' , $ content , $ matches ) ) { $ keywords [ ] = [ $ word , count ( $ matches [ 0 ] ) ] ; } else { $ keywords [ ] = [ $ word , 0 ] ; $ seoAlert ++ ; } } } // As the view path can not evaluated from controller context, we have to force the viewPath trough // the module instance. // @see https://github.com/luyadev/luya/issues/1768 $ viewSourcePath = Module :: getInstance ( ) -> viewPath ; // echo is used in order to support cases where asset manager is not available echo '<style>' . $ this -> view -> renderFile ( $ viewSourcePath . '/inline/toolbar.css' ) . '</style>' ; // mabye ensure that jquery is loaded,  better put this at the End of body tag echo '<script>' . $ this -> view -> renderFile ( $ viewSourcePath . '/inline/toolbar.js' ) . '</script>' ; echo $ this -> view -> renderFile ( $ viewSourcePath . '/_toolbar.php' , [ 'keywords' => $ keywords , 'seoAlertCount' => $ seoAlert , 'menu' => $ menu , 'composition' => Yii :: $ app -> composition , 'luyaTagParsing' => $ event -> sender -> context -> module -> enableTagParsing , 'properties' => $ props , 'content' => $ content , ] ) ; Yii :: info ( 'LUYA CMS Toolbar rendering is finished' , __METHOD__ ) ; }
Render the LUYA Toolbar.

@param \yii\base\Event $event
Render the LUYA Toolbar .