how can I pass model row counts to nav menu that is being used by multiple pages.
e.g:
I have a "Posts","Tags" in my navbar but then I would like to display the total number of posts in the table beside the title and this navbar is being used in various pages.
Is there a right way to do this, so I dont have to repeat the query "Post::count()","Tag::count()" all the time and passing it to every controller that is going to be needing the navbar partial? thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire