Thursday, May 23, 2013

Panada Framework


About Panada



Panada is a simple framework for the creation of websites based on PHP 5. Panada developed with the aim to help the website developers to work faster, easier and more natural in the writing of code. The official site and download the file.



Each component is designed to be mutually utilizing the resources from the other components automatically. This allows developers to resources quickly and efficiently.



To get the latest updates, follow twitter Panada i@panadaframework.

Features



* Simple

The main system (core system) Panada only consists of a file, which is located in the directory gear.php Panada. It aims to facilitate users in understanding the workflow Panada.



* Easy

With just a little fill in some parameters in the file apps / config.php Panada can be directly used.



* Single Load

Simply once shooting a component (component load) and the resource can be directly used in all other components. Retrieval can be done on the autoloader, inside the controller, in the model or in the library.



* Natural

In making a good component of the model or library, you just simply make once declaration as generally in declaring a class. For example:





code:

$this->nama_instance = new library_nama();



or



$this->nama_instance = new model_nama();


Both in the library collection or step model are the same. The difference only lies in the prefix (library_ or model_), class name that indicates the task and folder location.



* Multisite

Some websites can be created using the same one main system, be it with the main domain of the same or different.



License

Panada license is to use the BSD-License (http://www.opensource.org/licenses/bsd-license.php). With this license means that anyone can freely use this application either for commercial or non-commercial use.

Panada made by Indonesia people namely Iskandar Soesman



Here is the spec computer used to benchmark:



* Operating System: Ubuntu 10.04 LTS Lucid Lynx

* Web Server: Apache httpd 2.2.14

* PHP: 5.3.2

* CPU: AMD Turion (tm) 64 Mobile Technology MK-38

* Main Memory: 1.2 GB

* Hard Drive: 80 GB SATA





Use of the Controller and Model

Creating a Controller



To create a controller to add a new file in the folder apps / controller / and name in accordance with the desired, for example home.php. Create a new class in this file where the class is a subclass inherits from the Panada class, here is an example:



class Controller_home extends Panada {



public function
__construct(){



parent::__construct();

}



public function
index(){



echo
Hello world!;

}

}
That must be considered is the prefix name class. Where this prefix indicates the location of the class folder. For the controller, its prefix is "Controller_". The same is true of the class for the library, with the prefix "Library_" and the class for models with the prefix "Model_"



Make a Model



The model is a class whose job directly related to the handling of data, either from the database, or other storage systems.



To create a class model, add a new file and put it in the folder apps / model /, for example users.php.



Create a class users in this file by starting prefix "Model_", for example:





class Model_users {



public function
__construct(){



$this->db = new library_db();

}



public function
users(){



$result = $this->db->results("SELECT * FROM table_name ORDER BY id LIMIT 5");

}

}