0

I am new of Cakephp I stuck by using function find('list') to get data from other table inside User model. Example i have User Model want get List of group andgroup has table "groups" but i don't want create php files for group controller and group model.

    <?php
      //User model
       class User extends AppModel {

         public function getGroupList() {
            /* Here i want return list all group by use function find('list') 
             * but group has table name "groups" and i don't want use sql query string.
             * Note that group i don't create  files php in controller and model.
             */

         }

       } 
    ?>
4

1 回答 1

1

你为什么不想创建一个组控制器?做事蛋糕的方式通常会让你的生活更轻松。

在任何一种情况下都会涉及一个额外的 sql 查询(或至少是连接)。

于 2012-11-30T03:48:55.950 回答