C
C
criminalist2018-12-29 12:55:52
Yii
criminalist, 2018-12-29 12:55:52

Is it possible to create models in YII2?

Hello, who is well versed in YII2, the question is for you, Is
it possible to organize your own content models ? when I create a category for example "programs for windows", all the settings are applied from the finished model, in fact it gives unlimited possibilities to create each category or page its own templates and fields. As a result, when I create news in the article category for windows, for example, I have 5 fields: TITLE, SEO TITLE, DESCR, FULL DESCR, SOURCE.
When I create a post in the windows software category, I get a bunch of other fields: title, soft version, soft build, desc, version os, and the like.
And of course in the templates we get the output of all these variables, one for articles, others for programs.
I hope I explained it clearly)) I'm
interested in whether this can be organized in Yii, or not.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-12-29
@webinar

Yii is a framework built on the principles of MCV, so basically anything can be done there. All you need is sufficient knowledge of php, MCV and OOP + go over the documentation for yii

M
morricone85, 2018-12-29
@morricone85

So, what's so difficult about it? For example, you can create an Attribute table with fields:
id, attribute, value, news_id (news_id - link to the news)
1 title value 1
, etc. Maybe it's worth splitting it into several tables, if I understand correctly what you want to do. The only thing is that the TITLE, SEO TITLE, DESCR fields must be in the general table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question