• Your Cart is Empty
  • Cart
  • Log In


What is Akelos?

Akelos is an MVC (Model-View-Controller) platform similar to Ruby on Rails. It aims at helping programmers build multilingual database-backed web applications and write less code, which allows for the creation of uniform, simple to understand scripts. The Akelos PHP framework allows programmers to write views using Ajax, to control requests and responses through a controller, and to create and maintain internationalized applications. By using the conventions integrated in Akelos, developers can establish communication between the framework's models and databases. In order to distribute standalone web applications Akelos demands only that PHP be installed on the server.

Latest version: 0.9
Multiple DB
DB Objects
Auth Module

Akelos framework's feature list

Akelos is a modern PHP framework. It features:

  • multilingual models and views
  • locale alias integrated on URLs
  • database migrations using DB designer files
  • pure PHP support for Unicode
  • unit tested source code
  • code generators
  • a built-in XHTML validator
  • automated locale management
  • clean separation from HTML and Javascript using CSS event selectors
  • Ajax file uploads
  • AFLAX integration
  • Dojo Rich Text Editor
  • format converters
  • file handling using SFTP for shared host running Apache as user nobody (as most cPanel servers do)
  • distributed sessions using databases

The Model-View-Controller pattern in the Akelos PHP framework

Akelos applications are run on the same server where the Akelos software itself is located, communicating with it as it runs. An Akelos application consists of many small files instead of one single piece of code or a few larger files. The code itself goes into specific directories making it easier for programmers to debug.

Akelos can be used for accessing a MySQL or PgSQL database (through the model), processing the data (by the controller), and presenting it to the user (through the view). Then the user's input is accepted and processed. Here's a small introduction to writing MVC code:


That's the data model. The code is stored in the app/models folder. The class name is singular, camel cased e.g. PhoneBook. The file names are also singular but they are underscored e.g. phone_book.php.

As an example we will create a simple phonebook that submits data to a MySQL database. Your database details have to be filled in the framework's wizard which starts once it is installed.

Akelos offers a really simple to use command-line interface (CLI), which we can use to create our database tables. We just need to add the following code to "app/installers/tables_installer.php":

class TablesInstaller extends AkInstaller
// Define a function that creates a table “phones” with columns id, name and phone
function up_1(){
// Define a drop function
function down_1(){

and then execute the command:

./script/migrate tables install

so that the tables can be actually created in the database. Now we can use the integrated scaffolding function to build our phonebook application. Just need to run:

./script/generate scaffold Phone

Now we have a fully featured phonebook at http://domain.com/framework_base/phone/ which consists of a model, a controller and a view. The model consists only of a class definition for our phonebook application.


class Phone extends ActiveRecord

The Controller

The controllers determine how the data is to be processed. Their number depends on the logic of the program. The code for it is located in the app/controllers directory. The controller's class name can be singular or plural, camel cased and ends with Controller e.g. AccountController, BookController, etc. The names of the controllers' files can be singular or plural, underscored, ending with _controller, e.g. account_controller.php, book_controller.php. The controller's class has several functions, one function corresponding to each web page. There can be certain functions that do not access web pages or some code that has to be executed before the page is viewed. The function may also process the results when the user enters data on the page.

Our listing() and add() functions of the phonebook controller:



class PhoneController extends ApplicationController
# Redirect our index page to the phonebook listing
function index()
# Use the PaginationHelper class to set the number of results and use the model to get all the phones from our database
function listing()
$this->phone_pages = $this->pagination_helper->getPaginator($this->Phone, array('items_per_page' => 10));
$options = $this->pagination_helper->getFindOptions($this->Phone);
$this->phones =& $this->Phone->find('all', $options);
# If a new entry is posted, insert (save) it into the database
function add()
if ($this->Request->isPost() && $this->Phone->save()){
$this->flash['notice'] = $this->t('Phone was successfully created.');
$this->redirectTo(array('action' => 'show', 'id' => $this->Phone->getId()));

View (Action View)

The views, which are located in the app/views directory, have a subdirectory corresponding to each controller, e.g. app/views/account/. Within that subdirectory is located one template file for each page that is to be generated, e.g. app/views/account/show.tpl. So as not to make programmers write HTML or PHP code for the entire page, each page accesses a layout file containing code common to all of them. Akelos uses template files that have helpers for adding forms, fields and data loops, to generate PHP files that in fact render web page - the building unit of a website.

Our add.tpl example that corresponds to the add() function of the controller


<div id="sidebar">
<li><?php  echo  $url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li>

<div id="content">

  <?php  echo  $form_tag_helper->start_form_tag(array('action'=>'add')) ?>

  <div class="form">
<h2>_{Creating Phone}</h2>
<?php  echo   $controller->renderPartial('form') ?>

  <div id="operations">
<?php  echo $phone_helper->save() ?> <?php  echo  $phone_helper->cancel()?>

  <?php  echo  $form_tag_helper->end_form_tag() ?>