Yii 2 FAQ

So thinking along the same lines, what if the client wants to grab a group of specific questions and present them on different parts of the application? We can antiicipate that they may well do that, so we can create a boolean field on the db for is_featured. That way if we need to call a group of featured FAQs for special presentation, we have an easy way to extract those FAQs, we just call FAQs where is_featured is set to yes, in other words, a 1.

We covered the cosmetic aspects of showing the boolean value as true or false in an earlier tutorial, so we won’t be repeating here. In fact, for this tutorial, we are not going much deeper into the data structure or the backend UI.

If you have been following along in the book, then you know how create UI using Gii, Yii 2’s automatic code generator. Since it’s so easy to create the create and update forms, managed from backend UI, we will simply assume that at this point, you know how to do it.

So what we’re going to do that’s different here, is take a backend model and create a separate frontend UI for it, this time utilizing the ArrayDataProvider that we have not used yet.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s