如何使用CakeDC的用户插件实现MilesJ的论坛插件?
在http://milesj.me/code/cakephp/forum#user-setup实施论坛插件的说明。但是,它并不期望用户系统使用插件。
这是模型“AppUser”(CakeDC强制命名的名称):
App::uses('User', 'Users.Model'); class AppUser extends User { public $useTable = 'users'; public $hasOne = array('Forum.Profile'); public $hasMany = array('Forum.Access','Forum.Moderator')); }
我继续收到以下错误......
Warning (512): Model "User" is not associated with model "Profile" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339] Warning (512): Model "User" is not associated with model "Access" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339] Warning (512): Model "User" is not associated with model "Profile" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339] Warning (512): Model "User" is not associated with model "Access" [CORE\Cake\Model\Behavior\ContainableBehavior.php, line 339]
我如何确保论坛和用户插件之间有正确的关系?
答案 0 :(得分:0)
app/Plugin/
现在转到app/Plugin/Forum/Config/Schema
文件夹并将所有sql文件放入数据库,前缀为“forum _”
如果您正在使用auth组件,那么它将自动运行,完成上述步骤后转到http://example.com/forum/ 5.然后在(项目的)用户模型中添加以下关系
public $ hasOne = array('Profile'=> array(
'className' => 'Profile',
'foreignKey' => 'user_id',
'dependent' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
)
Fatal error: Call to a member function image() on a non-object in /var/www/projectname/app/Plugin/Utils/View/Helper/GravatarHelper.php on line 89
这些将你的HTML助手放在app / Plugin / Utils / View / Helper /
中最后一切都需要工作..刚才我开始实现这个..如果你遇到任何错误让我知道