0

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?

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
Roby Sottini
  • 2,117
  • 6
  • 48
  • 88

3 Answers3

2

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)

Ash-b
  • 705
  • 7
  • 11
1

You could use renderPartial as below:

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

for simply remove the tool bar you should check in your view/layout and remove the footer part form the layout you are using ..

eg for the default layout name main.php
you can simply comment the related part eg:

<footer class="footer">
    <div class="container">
    <p class="pull-left">&copy; my Copy  <?= date('Y') ?></p>
    <!--p class="pull-right"><?= Yii::powered() ?></p-->
    </div>
</footer>

instead if you want remove the debut toolbar showd click on botton right side with the yii logo

you must look in you config file main-local.php or main.php and commment or remove the part that invoke the debug tool eg: commenting the boostrap invocation

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    // $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

commenti the $config['bootstrap'] the related code is not loaded and use

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107