I am creating a bake template using Twig for a cakePHP project. All what I want is to access the tables names of the database and their fields using twig to generate code based on these tables and fields.
I could easily access the tables names using (BUT THIS IS NOT WHAT I WANT)
use Cake\Datasource\ConnectionManager;
$db = ConnectionManager::get('default');
$collection = $db->getSchemaCollection();
$listTables = $collection->listTables();
I want to write something like that
{% set db = ConnectionManager.get('default') %}
{% set collection = db.getSchemaCollection() %}
{% set listTables = collection.listTables() %}