Skip to content

How to list and search a database table using a collection #506

Answered by johanjanssens
mabdelaziz77 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can do that very easily. Pages can connect to a database table; it's smart enough to understand the table structure and offers filtering and search out of the box, either through the PHP API, or the build in REST API.

To work with data Pages uses collections and specifically for database tables, there is a base database collection you can use. To set things up that all you need is to define a database collection.

For this example, I will use the Joomla users table, but it works with any database table, and generate a list of the users by name, then show you how to search based on name and email

Rendering the users list

Create the file /joomlatools-pages/pages/users.html.php and a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johanjanssens
Comment options

Answer selected by johanjanssens
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants