PHP OOP: Traits
What is Traits? Code is shortened by using Traits. One code is used everywhere just by writing the trait function. Example : Output: Multi traits use example: Output:
From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.
With Motoshare, every parked vehicle finds a purpose.
Owners earn. Renters ride.
🚀 Everyone wins.
What is Traits? Code is shortened by using Traits. One code is used everywhere just by writing the trait function. Example : Output: Multi traits use example: Output:
Late static Binding: Late static binding helps to override name by using static in echo keyword. It helps lot for writing minimum coding. The message of the base class is printed using the self keyword and the message of the derived class is printed using the static keyword. Example to printing the message of base … Read more
What is Static Members ? Static properties and methods can be used without creating an instance of the class. The static keyword is used to declare properties and methods of a class as static. Object not create. Stack keyword use before access modifier. Inside class use self::(use static method). inherit use parent class name ::(properties). … Read more
What is Interfaces? Interfaces help us to use multiple classes in a single class inherit. Interfaces are declared with the interface keyword. Derived class is called derived class. object not be created in interface. Property should not be defined in interface(class). All interface methods must be public. All methods in an interface are abstract. To implement an … Read more
Overriding Properties : Same properties on both classes (base and derived class). Overriding Methods : Same name of method on both classes base or derived class.
What is the access modifier? Restrictions on properties and methods. Types of access modifier public protected private Public : Access on base as well as derived class and outside of the class. Everyone can see and access the data. Not secure. Override use. Protected : Base and Derived class. No one gets access throughout the … Read more
What is inheritance in php? Inheritance is properties of PHP. Accessing the feature of one class of another class. Three types that is single, multiple and multilevel inheritance. It is the four pillars of oops. It allows a class to reuse the code from another class without duplicating it. Two classes one is base/main another … Read more
JavaScript : JavaScript is used to create client-side dynamic pages. JavaScript (js) is a light-weight object-oriented programming language. JavaScript is not a compiled language, but it is a translated language. The JavaScript Translator (embedded in the browser) is responsible for translating the JavaScript code for the web browser. JavaScript, users can build modern web applications … Read more
Easily change the vertical alignment of inline, inline-block, inline-table, and table cell elements. Change the alignment of elements with the vertical-alignment utilities. These are the classes:- .align-baseline, .align-top, .align-middle, .align-bottom, .align-text-bottom, and .align-text-top as needed.
Text Utilities classes, contains various text properties, such as, text alignment, text wrapping, text overflow, text transformation, font weight, italics, monospace, resetting color of text, removing text decorations. 1. Text alignment : .class text-justify .class text-left .class text-center .class text-right .class text-sm|md|lg|xl-left 2. Text wrapping and overflow : .class text-wrap .class text-nowrap .class text-truncate 3. Word … Read more