プログラミングノート
id:white-lilium
CakePHP3 データベースにデータを挿入
CakePHP3でデータベースにデータを挿入する方法を書きます。 1.TableRegistryクラスを使います。use Cake\ORM\TableRegistry; 2.getメソッドの引数にテーブル名を指定し、TableRegistryオブジェクトを作成します。 $booksTable = TableRegistry::get('Books'); 3.TableRegistryオブジェクトのnewEntityメソッドを使…