I’ve made few years ago medium sized project in Yii and I was amazed how easy and fun it was. I’m not every day programmer so I felt empowered by Yii, felt that I could do with Yii a lot more than I would ever do with out it.
Now trying to do small one, just 9 tables. It took me a very long time just to import part of logic that was already used in previous project. I thought I will do all in just 7 days, instead importing 5 tables took me 2 weeks!
I feel really frustrated how hard Yii 2 became. In Yii 1 i spent few hours on reading docs and already understood how to tweak generated code to my needs. Just needed to look into docs for details here and there.
Now i can’t figure out how to do things that I have already done. The main reason behind it is bad documentation. It is really, really bad. It’s just terribly bad.
Examples? In Yii 1 you could throw in htmlOptions array anywhere and put html code there. Very simple. In Yii 2 sometimes it’s method content, sometimes HtmlContent and on top of this it’s not even mentioned in docs.
Now i’m trying to figure out how dataProvider works now, why it works with find(), but not with find()->all()?
How to make sorting? Docs states “The sorting object. If this is false, it means the sorting is disabled.” That’s broing stuff that inborn could guess. But how to configure it? On top of that i try to pass false to turn it off since i cant figure out how to use it. Simply passing ‘sort’ => false doesn’t work as well. It made me so frustraded that have to write this post.
I spent so much time to configure single date field with datepicker that it’s shame to mention.
Active data provider works with query (alike 1.1 criteria) i.e. what’s returned from find(). It modifies it accordingly to achieve sorting and pagination. Data is obtained via the modified query in the provider itself.
all() causes getting records themselves so despite the fact that you can use this data via array data provider, it’s very inefficient.