Welcome Guest, Not a member yet? Register   Sign In
Best way to create a notifications system in nav bar


I want to create a "notification system" with an icon in the nav bar that shows the notifications.

This notifications shows in every page.

What is the best way to do this?

I have 2 different "base controller". 1 for logged users and 1 for not-logged users.


Do you want to create the notification system only for the user they are logged in?

Notification System = Controller + Model + View, and it show every page load or ajax request

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams


Pfeilei, the notification shows to everyone, logged or not.

Nc03061981, the controller is for the page. Inside the page there is a nav bar with the notifications. How can use the page controller and the notification controller at same time?

(This post was last modified: 10-21-2020, 06:16 AM by T.O.M..)

You can use notification library (instead of notification controller) and call it in page controller.

Alternatively you can use View Cells or View Partials in your main layout - depending on how you organize the output.

With that I would go with what @T.O.M. but use view cells this way you can always
customize it in one location.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Ok, View Cells is a good solution.

Thank you

Theme © iAndrew 2016 - Forum software by © MyBB