putyourlightson / craft-entry-count

Counts and displays the number of times that an entry has been viewed in Craft CMS.
MIT License
47 stars 19 forks source link

syntax error, unexpected 'return' (T_RETURN) #7

Closed hql287 closed 7 years ago

hql287 commented 7 years ago

I have this error after finished the "Template Variables" video on Mijingo.

.../craft-cms-plugin-dev/craft/plugins/entrycount/variables/EntryCountVariable.php(28)
 public function getCount($entryId)
17     {
18         return craft()->entryCount->getCount($entryId);
19     }
20 
21     /**
22      * Returns counted entries
23      *
24      * @return ElementCriteriaModel
25      */
26     public function getEntries()
27     {
28         return craft()->entryCount->getEntries();
29     }
30 
31     /**
32      * Increment count
33      *
34      * @param int $entryId
35      */
36     public function increment($entryId)
37     {
38         craft()->entryCount->increment($entryId);
39     }

I tried to copy and paste your code into the file but it did not go away.

Craft CMS 2.6.2973

hql287 commented 7 years ago

Nevermind, I found some typos and it works now!