Controller側のforeachがおかしいですね。まぁこれをView側でやってもいい気もしまうが
php
1 function index() {
2 $this->Entity->setDataSource('hive');
3 //DB一覧取得
4 $sql ="select * from DBS;";
5 $result= $this->Entity->query($sql);
6 //debug($result);
7 $p_database= [];
8 foreach($result as $dbs) {
9 $p_database[] = $dbs['DBS']['NAME'];
10 }
11 $this->set('para', $p_database);
12 }
View側も書いておきますね...
php
1<h2>一覧表示</h2>
2<ul>
3 <?php foreach($para as $name): ?>
4 <li><?= h($name) ?></li>
5 <?php endforeach; ?>
6</ul>