Add documentation and update notes for Models, Records and Controllers #299
Unanswered
lazlo-bonin
asked this question in
Ideas
Replies: 1 comment
-
Yep we should have some mention of these things. However in Craft 3 models and records work the same as in Yii, which wasn’t the case in Craft 2, so the Yii documentation is the best place to start. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Craft 2 plugin development documentation included information about Models, Records and Controllers which is no longer contained at all in the Craft 3 docs.
The current upgrade guide only mentions a very vague reference back to the Yii documentation for all of these concepts, without any specific instruction on how to port plugins that used them in Craft 2:
Considering the big changes (e.g. using actual PHP attributes instead of
defineAttributes()
on models), this really hinders efforts to migrate plugins to Craft 3. It also led me to believe that Models and Records were no longer supported classes for Craft 3 plugins, until I delved into official P&T plugins like Digital Products to notice that they are indeed still used! This has us piecing up classes from the Craft 2 docs, Yii 2 upgrade docs, and reverse engineering... Far from ideal.Here's the current table of core classes that are documented, which I'm making partly for myself to keep navigate through the upgrade process...
Is there an update planned for the core Models/Records/Controllers documentation, along with examples of how to create and use them in Craft 3?
Beta Was this translation helpful? Give feedback.
All reactions