Function behavior() in the view

Hі there. Sorry for the stupid question - just starting to learn the framework.

I want to take advantage of the built-in anonymous function - function behaviors() to close the page from the public.

How to use it through the controller understood.

What should I do if the page has only a template (views) are not connected to it does not have model or controller.

How to use this feature behaviors () in the view?

I use Yii2 basic 2.0.7

Thank you.

Welcome to the forum.

I think your question is too vague or abstract to be answered. Could you elaborate your question in more specific and concrete manner, preferably with some example?