Friends, in the themes folder, I see the classic files, the folder structure in it, and they are all empty. In / protected / views - the display of elements within this framework-template.

How to make your own theme? In the official documentation there is little information and nichrome is not clear. Here I will make my folder with the structure and files. (classic and empty, where to take an example?)

Ok, in layouts / main.php - the layout of the main page, and what kind of views then in site / index.php?

And how to register inside files where and what should be displayed? What is this widget, what is that view, etc.? How to indicate in the template that in this place I want to display the type of authorization that is in / protected / views / autorise.php? Where should I store css, js, Feng Shui pictures?

Nothing is clear to me. Where can I read more? Or see an example? Or some video tutorial?

    3 answers 3

    In / protected / views / layouts you have the main templates for your controllers, through which the content generated by your actions will be displayed. that is, when you create the SomeStuffController controller, the / protected / views / layouts folder will automatically create the somestuff.php view, which will be the base for all actions of the SomeStuff controller. In addition, a folder with the name identical to the name of the action will be created in the folder / protected / views, in this case it will be the directory somestuff, and it can be reached via the path / protected / views / somestuff. In this directory will be the index.php file, which will correspond to the actionIndex action controller someStuff. Actually, in this file you need to describe the template, in accordance with which the content from the index action will be displayed.

    The question is generally incorrect.

    • Can you help with this question? Suppose I have a page that needs a different frame at the root (hat and footer others). I create it in layouts / another.php And how can I call it for the desired link, for example, about? - butteff
    • Why an incorrect question? in YII you can make your own themes - Ale_x
    • Topics based on what? On the templates. Yii is a framework, not cms, respectively, what future templates will look like depends only on the developer - nolka
    • butteff, action, displaying content with a different design is in the same controller as the rest, or in another controller? - nolka

    There are themes in YII, and they are formatted with the same structure of files and folders as is the organization of the views in the protected / views folder. The main point is to connect the topic in the config. And even if there was no view in the folder with the topic, YII takes the view file to protected / views - in principle everything is simple and logical.

    The details here. Better there, I will not sign for it, and the meaning. If anything is not clear, ask.

      no need to create your own theme, and you can download them.

      for example such

      Well, in fact - you need to add one line in the config / main

      return array( 'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..', 'name' => 'myname', 'theme' => 'shadow_dancer', 

      Well, then you can deal with css topics and other tricks. like so