Advertisement

Responsive Advertisement

What is the RibbonPHP?

In short, the RibbonPHP is a PHP Framework. It is the simplest framework adopting a Model-View-Controller (MVC) structure and Object-Oriented Programming paradigm. The fundamental difference between RibbonPHP and other PHP Frameworks like Symphony, CodeIgniter, Laravel, etc. is that RibbonPHP has less files, easier, and pure. One can say that RibbonPHP is an "empty PHP framework" that gives the users a full control toward what other libraries they want to use with it and how to use them along with it.



It is almost similar to CodeIgniter

If you are familiar with the CodeIgniter, it will be very easy to use RibbonPHP since the structure of the directories and files are almost similar with CodeIgniter. It is not wrong to say that RibbonPHP is a minimalist version of the CodeIgniter. Though, RibbonPHP does not miss most important features that a PHP Framework should have.

Before I developed this framework, I used to be a "conventionalist PHP programmer" with procedural programming paradigm fossilized in the head. However, after several years developing and using this framework, I have forgotten how to build a PHP-based website, especially database app, by using procedural style. I think that it is no point to return to the "old school method" of coding my PHP app because this framework has helped me to build secure PHP app.

I've never used CodeIgniter before, to be honest. I tried Laravel but, alas, I was not good enough and to me, Laravel is difficult. To build a PHP app using Laravel, I felt that I must learn not only PHP but also Laravel itself. I watched several tutorial videos about Object-Oriented Programming in PHP and MVC model from the internet and I ended up developing this framework. Later, I discovered that that the structure and workflow of this framework is similar to CodeIgniter.

The structure of RibbonPHP is easy to learn since it has only four main directories:

  1. Core directory: this is a directory where all core classes are stored including Router, Configuration, Controller (this should not be confused with controllers, Database Wrapper (this uses Prepared Statement to avoid SQL Injection), Session, etc. Most of the files in this directory are not to be modified by the users.
  2. Controllers directory: this is a directory where all controller classes are stored. The classes are user-made. The controllers can be understood as the routes of the web app they are creating. Within each controller (e.g., home) are methods and parameters to pass to the method, if any.
  3. Model directory: this is a directory where all models are stored. Models are classes that the users create to process the data (e.g., from Database, API, etc.). Sometimes, a model is not necessary for a controller.
  4. View directory: this is a directory where all views or frontends are stored. Many controllers require view but not all. A view is a PHP file that display the data or content that a controller is supposed to serve. It can accept PHP, HTML, CSS, and JS. It is in the view that ajax calls are made although users can write them in separate JS file and include it by using script tags.

It was ViperPHP

Before, the framework was named ViperPHP. However, I found that someone else had taken that name to name his framework which was completely different in structure and workflow. Thus, to avoid confusion, I rename it to RibbonPHP. Do not overthink why the name is RibbonPHP, it is just a name. There is nothing inside the name but an identity.

RibbonPHP is not only a new name for an old framework. Along with renaming it, I also made many changes within the framework, especially the features and workflow.

ViperPHP was a PHP framework with Bootstrap, jQuery, AOS, and many other libraries ready. When I developed it to be RibbonPHP, I excluded those libraries by default. The users are free to any libraries (as many as possible) without slowing down their app. The technique will be discussed in different posts.

Features of RibbonPHP

Although this framework is not as sophisticated as other PHP frameworks, it covers main features that all PHP frameworks should have, including:

  1. Security: RibbonPHP is secure from SQL Injection, XSS, and any other attacks. It sanitizes all inputs either from forms or urls. Classified pages can be secured from unauthorized access by using Sessions very easily, and so on.
  2. Convenience: there is no need to develop a PHP framework if it does not serve convenience to the users. RibbonPHP is dedicated to bring ease to the users to build a PHP web app. Users can do copy and paste from one script to another and make minor changes. For example, most methods in the controllers that require views can be copied and what the users need to change is the name of the method and view. There is no need to retype!
  3. Ability to adapt with many libraries: with RibbonPHP, users can include any libraries except those designed to be used with Node JS. I had a hard time to accomodate this feature but until today I could not figure out how to do that. Perhaps, other experienced users can contribute to solve this issue. However, I have used this framework to work with BrainJS, CompendiumJS, CompromiseJS, RitaJS, and other JavaScript libraries and it worked as expected. As long as those JS libraries can be included from the client side, we are good to go.
  4. Less files: less files does not always mean less feature but it always means less junk files. Many PHP frameworks provide features that users never use in their app. It does not apply to RibbonPHP. In this framework, it covers users' fundamental needs for a PHP web programming.
  5. Freedom: last but not least, RibbonPHP gives freedom to the users to use it as they wish. It is also free (like free coffee) and as an open-source, anyone can contribute to its development.

That's it. RibbonPHP is a promising PHP framework. It can be developed further depends on the users' needs (and, of course, their contributions).



Post a Comment

0 Comments