View Single Post
Old 07-14-2008, 04:45 PM   #1 (permalink)
abiko
The Contributor
 
abiko's Avatar
 
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
abiko is on a distinguished road
Default Advices on a framework

Currently I'm developing my own lightweight framework for simpler apps..
I want your advice on some aspect if it - mostly on the database backend, controller functioning and template processing.

First things first:

Controller
Controllers are defined in a config file, you could call them routes. If an non exsistent controller is entered the default controller is called.
It is a copy of an idea you can find in Zend/Kohana etc.

Database Backend
For every aspect of database operations there is a single class for it - connect to the database, select, insert etc..
Here is a sample how to get a data from the table:
PHP Code:
$select = new x3Database_Select();
$select->Select'title, sadrzaj');
$select->From('frame_blog');
$select->Where( array( 'user_id' => '2''active' => '1') );
$select->Limit('0,10');

$handle $select->exec();
while( 
$r x3Database_Fetch::Assoc$handle ) ) {
       
$kr[] = $r;

Templating
Templates are in a pure-php style. Class used for it can parse and output or "compile", or sub-process the single part, a module, and return the processed part to the main template, the main design.


Can you suggest some ideas to the whole concept, or correct me where I'm going wrong. Thank you!!
__________________
Back from sysadmins to the programmers.
Send a message via ICQ to abiko Send a message via MSN to abiko
abiko is offline  
Reply With Quote