C
C
cirega2016-02-13 12:54:00
Yii
cirega, 2016-02-13 12:54:00

How to correctly implement sidebars in yii2?

Hello everyone, have a question about yii2? how to competently implement work with sidebars, let's say on the main page I want there to be no columns, but on others, and in order not to copy-paste the template, how to correctly prescribe the conditions for displaying the columns?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Karen Kratyan, 2016-02-13
@cirega

Maybe sidebars?

// views
$this->params['showSidebar'] = true;
// $this->params['showSidebar'] = false;

// layouts
if (isset($this->params['showSidebar']) && $this->params['showSidebar']) {
  // show sidebar
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question