[CakePHP 2.x]テーブルのカラム名を取得
テーブルのカラム名を取得
$this->Model->getColumnTypes();
Controller
$columnTypes=$this->SystemTest->getColumnTypes(); $columnNames=array_keys($columnTypes); $this->set('columnTypes', $columnTypes); $this->set('columnNames', $columnNames);
View
columnTypes<br/> <?php $tmp=var_export($columnTypes,true); echo str_replace("\n", "<br/>", $tmp); ?> <br/><br/> columnNames<br/> <?php $tmp=var_export($columnNames,true); echo str_replace("\n", "<br/>", $tmp); ?>