Makes a navbar for a website with object oriented php
I think you have some reading/research to do as I'm not sure you understand OOP...

What is Main?


Main is setup as a class, used as a namespace in instantiation, then extended(why?).
Generally in the context it seems to be intended to be used App or &lt;AppName&gt; are better options


When to extend


Why do all elements extend Main?


It appears to be solely for it's constructor which it never uses itself. (Extra Baggage in Main)
Main also only contains functions the other elements never need or use (Extra Baggage in the Sub-Objects)

Extending a class makes more sense if the classes extended from it share functionality


What even is an Object? ##


You seem to be using your objects as functions disguised as things.


For example: when you create a navItem:
You create the object
It's controller prints itself to the screen
You capture it in a variable never to be used again. Why?



Who gets to be an Object?


navItem is an object navBar Isn't
navDropdown is an object navDropdownItem isn't