列出cakePHP 3.x中的所有表 [英] List all tables in cakePHP 3.x

查看:62
本文介绍了列出cakePHP 3.x中的所有表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力解决这一问题。在cakePHP 2中,我可以使用:

I have been trying to work this one out. In cakePHP 2 I could use:

$tables = ConnectionManager::getDataSource('default')->listSources();

但是在CakePHP 3.x中,我无法确定要使用什么?
我看过链接 cakephp获取表列表的架构

But in CakePHP 3.x I can't work out what to use? I have looked at the link cakephp get schema for list of tables

不幸的是,它对CakePHP 3.0没有帮助吗?

Unfortunately it doesnt help with cakePHP 3.0?

推荐答案

我们可以使用与

$tables = ConnectionManager::get('default')->schemaCollection()->listTables();

这篇关于列出cakePHP 3.x中的所有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆