Before you begin to discover the wonders of X3CMS let us see the pros and cons of this CMS.
- does not have a community: you can partecipate, if you want
- the documentation is poor: is an hard work that I can do only in my spare time
- no modules and themes to download: I'm working on, soon...
Pro in general
- is not very common so is less susceptible to attacks
- X3CMS once installed is ready for posting content with little or no configuration
- has been developed to meet real needs: versatility, flexibility, speed and security
Pro for developers
- it is really simple, the structure of files and folders is clean and straightforward
- to find out how the engine works just open a dozen files
- X3CMS has interesting features that many famous, backed by numerous community, adopted only recently or have not (e.g. PDO on Drupal comes only with version 7, the concept of areas, the MVC engine and many other little niceties)
- developing X3CMS we have tried to minimize the necessary knowledge to manage it:
- X3CMS is an application written on an MVC framework derived from Kohana (version 2.x)
Although it is simple, it is an MVC framework that can be extended to add functionality to X3CMS.
It can also be used as a basis for developing web applications without the need to learn to use other instruments (e.g. X4ToDo).
Who should use X3CMS
- young developers who want to experience on a CMS that they can really understand and disassemble
- programmers who want a simple basis on which to develop medium and big projects
- web agencies who want to differentiate themselves by offering a solid and manageable product.
X3CMS is developed with the goal of having a tool that can easily adapt to any project.
Many features in the design of a common job in a web agency are not needed and can seem like an unnecessary complication, experience has taught me that many projects are born small and then become complex and it is not advantageous to do it all over again.
- Multi-language sites
- Sites with one or more private areas
- Public parts of sites with totally different graphic
- Creation of landing pages delegated
- SEO needs
- Integration with external libraries
- Use of multiple databases
- Page caching
- Complex layouts
- Add pages with features not provided
- Have more of an administrator (who manage the site)
- Have more than one publisher (who insert contents)
- Transform a website into a web application
X3CMS is a tool made to allow the developer to address all these eventualities with no problems, with five clicks you install the CMS web site ready for a basic need and then, if you need, add the rest.
The code has been written with these two rules in mind:
- KISS (Keep it simple stupid)
- LESS IS MORE
How it works
All php files are handled by the framework, other files (txt, html, css etc..) are handled transparently.
Everything starts from the file page.php:
- Define the PATH constants
- Upload files config.php and X4Router_core.php
- Launch the core X4Core_core.php
The URL is analyzed in X4Core_core, eg:
NOTE: language and area can be omitted if you have a single language and single area in the website.
X4Core_core checks if there is a controller in the area (public in this example), example: the call to http://www.mysite.com/it/public/search will be redirected to /cms/controller/public/search_controller.php and will run the default method (named default).
If the controller not exists then X4Core_core calls the basic controller /system/controllers/X4Page_controller.php
This controller uses the value of the controller as page name and looks for it in the DB (table pages). If he finds the page and the page is active, displays the contents else it displays a blank page with error message.
In this way you can create pages with only content or special pages with additional features.
Model View Controller
At the base of X3CMS there is an MVC framework. X4Core_core calls the controller and executes the method, the method calls the template and populates the view.
All interactions with the database (queries) are in the model that inherited some methods to perform with ease the most common queries.
Typically the result of the query is passed directly to the view, sometimes can be required to do complex manipulations so you have ad hoc methods in the controller or in the model or you can use helpers calls. Helpers are libraries with static methods.
X4Utils_helper.php is a library that contains the methods used in the presentation of the pages of CMS, other helpers are more specialized: X4Form_helper, X4Validation_helper, X4Files_helper and so on.
Additional features are implemented through libraries, for example: /system/libraries/phpmailer to send email. Libraries are typically carried out by third, to integrate them into the CMS there is a file that performs the necessary import and/or initialization for example /system/libraries/phpmailer_library.php.