Hello everyone, today I want to present you my latest website project for shaiya.
this site is not like all the others, this site is based on a php framework, the use of the latest version of php (7.2)
the php framework works with the MVC logical system
As with other software patterns, MVC expresses the "core of the solution" to a problem while allowing it to be adapted for each system. Particular MVC architectures can vary significantly from the traditional description here.
Components- The model is the central component of the pattern. It is the application's dynamic data structure, independent of the user interface. It directly manages the data, logic and rules of the application.
- A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants.
- The third part or section, the controller, accepts input and converts it to commands for the model or view.
Interactions
In addition to dividing the application into three kinds of components, the model–view–controller design defines the interactions between them.[8]
- The model is responsible for managing the data of the application. It receives user input from the controller.
- The view means presentation of the model in a particular format.
- The controller responds to the user input and performs interactions on the data model objects. The controller receives the input, optionally validates it and then passes the input to the model.
[Only registered and activated users can see links. Click Here To Register...]
I do this thread to show everyone that currently the sites we are using are really obsolete.
currently using this framework (YII2), we can go to remove all the queries, and more, let's see...
What is Yii2?
Quote:
|
Yii is a high performance, component-based PHP framework for rapidly developing modern Web applications. The name Yii can be considered as the acronym for Yes It Is!. Yii 2 inherits the main spirit behind Yii for being a simple, fast and highly extensible PHP framework.
|
Using a framework instead of PHP's native OOP has several advantages, let's try and list some of them:
Organization
When you have a very complex project in your hands, it is not enough to "dirty" the code. Writing native PHP code is likely to make several mistakes. Using a framework helps you not to commit them by giving the right organization to the files and the code, taking you to the correct direction.
Integrated features
A framework keeps you focused on your real work, providing you with all the basic features such as routing, authentication or form validation. Your time is precious, do not waste it trying to reinvent the wheel! Use the time you have available to increase the quality and completeness of your software.
URL Seo Friendly and Routing
Forget about the URL rewrite. Each framework has within it a routing module that allows you to easily manage all the routes of your application. Moreover if you need to generate SEO-friendly URLs starting from the titles of your pages, you will already have all the functions available.
MVC (Model View Controller)
Most PHP frameworks use an MVC pattern, which allows you to divide the code into Models, Views and Controllers. What are they?
Models: provide you with a high-level interface with the database.
Views: contain the templates of your project
Controllers: contain the logic to extract the data to be passed to the views.
We can then reconnect to the paragraph "Organization": the code remains more orderly, so in case of problems you will be able to solve them as quickly as possible.
Safety
A framework protects you from many types of attacks. Forget SQL Injection, CSRF attacks and many others. Less worries = more time to devote to your project.
ORM
If you need to do very simple queries, forget the SELECT * FROM posts WHERE bla bla bla. Most frameworks allow you to easily perform almost any high-level query with Object Relational Mapping. Instead, if the query is more complex, you will be able to optimize it and make it faster than the old style in plain SQL, without banging your head too much on the keyboard.
Performance
A framework helps you manage the caching of views, and other optimizations that improve performance.
After giving you this information, I ask the alleged dev remained, what do you think?
would not it be time to change? and offer something safer?
I would like to know what you think, do you say it's time to change?
do you have any useful tips, or anything?