aschelch / cakephp-notification-plugin

CakePHP Notification Plugin provide an notification system
25 stars 9 forks source link

How to use this plugin in CakePHP 2 ? #5

Closed tonyvince closed 5 years ago

tonyvince commented 8 years ago

I am getting an error "Table notification_notifications for model Notification was not found in datasource default".

aschelch commented 8 years ago

You have to create the table in your database using the file https://github.com/aschelch/cakephp-notification-plugin/blob/master/Config/Schema/schema.sql

tonyvince commented 8 years ago

thank you i created the database .But now I am getting a new error Error: Call to a member function notify() on null app\Controller\MyController.php Line 183 the corresponding code is
$this->User->notify($this->Session->read('Auth.User.id'), 'request_add', array('User'=>$this->Session->read('Auth.User.id'),'Request'=>$request_id,'Category'=>$request_category_id));

I am using CakePHP 2x . Please help

aschelch commented 8 years ago

Its not an error from the Notification plugin. Apparently the model User is not loaded in your controller.

Did you load it ? (using public $uses = array('User);)