O
O
Oleg-Ukraine2017-07-27 10:04:27
Yii
Oleg-Ukraine, 2017-07-27 10:04:27

How to check template version?

Good afternoon, I am writing an extension for Yii2, I really want to make it universal, for all universal versions of templates. Tell me how you can accurately check which version of the template is deployed by the user in the basic or advanced application?
And if I have advansed, can I somehow access the settings of each application through Yii::$app: frontand, backand, console, common?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya Karavaev, 2017-07-27
@Quieteroks

And what will you do if the user of your extension does not use standard templates? If I'm not mistaken, Yii allows you to organize folders however you like. For example, the same Easyii uses its own template, taking the contents of the web folder to the root.

M
Maxim Fedorov, 2017-07-27
@qonand

What difference does it make what version of the template? a template is just a blank of the project, some way of organizing it and nothing more. The template can be not only basic or advanced, but also some kind of custom one. If your extension depends on the template type, this is no longer correct and not universal. Therefore, it’s better to think about how to make it without being tied to a specific template, or create a corresponding question on the toaster

M
Maxim Timofeev, 2017-07-27
@webinar

I want to make it universal, for all universal versions of templates

Do it. They are all like that. Extension is an abstraction. He doesn't care what pattern. What is your problem with this?
Can. for exampleYii::$app->components

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question