yii2footerhtml.renderpartial

Yii2: don't show footer for some views


I want to not show the footer of a typical Yii view. View

The function that render the view is very short:

public function actionPrintReport() {
    return $this->render('_myReport', []);
}

How can I hide it?


Solution

  • you can create your custom layout and use it wherever you want to hide the footer

    public function actionPrintReport() {
    
       $this->layout = 'yourNewLayout';
    
       return $this->render('_myReport', []);
    }
    

    go to app\view\layouts and create a new layout. ( copy the existing layout and just remove the footer from it)