A method (called articleIncViews) to increment the number of views (field views in database of a articles table).
It's used by example for added a visit counter on a article.
NB:
- The "views" field can be changed if you have another namespace in your database.
- It can be used on any table with integer field named "views".
Cakephp 2.8
0.1
Copy the method articleIncViews into app/Model/AppModel.php
Call this method in our controller (ArticlesController.php by example) :
// increment views
$this->BlogArticle->articleIncViews($article['BlogArticle']['id']);
Nicolas HENRY