The SitePoint PHP blog has posted a tutorial continuing their look at the features of the Yii2 framework. In this latest post author Arno Slatius covers the use of the GridView and ListView components to render tabular data.
In my previous article about Yii 2.0, I introduced the ActiveRecord implementation. Once you have some data in your database you’ll want to be able to show it. Yii uses DataProviders to interact with data sources and it provides some widgets to output the data. Of these, the ListView and GridView provide the most functionality.
In his example he shows how to render tags about authors, articles and related tags into a simple table with contents provided by a data provider. He talks about the three different types of providers, activedata, sqldata and arraydata, and briefly shows each in use. He shows how to configure the GridView element to use the provider and set up the column data. He also covers the use of the sorting and pagination functionality already built into the tool.