Menu

Home

Naanal PHP Framework Aruna Devi Tamil Amuthan

Naanal PHP Framework

Introduction

Naanal is modular framework. It can be extended easily by adding more modules. The Naanal framework has to be kept always outside the application directory.
The Demo is available at http://auieoerp.com/wsplugin


Installation

It has very simple installation procedure. Just need to extract the zip file. And point the Naanal main file(naanal.php) in the application's main file(index.php).


The Framework has 2 type of inputs. 1) page param 2) action param
page param
This is the input param represents module's controller class. This param is passed to the application using URL Get or URL Post.

Ex: index.php?page=accounts
action param
This is the input param represents module's controller class's method. This param is passed to the application using URL Get or URL Post.

Ex: index.php?page=accounts&action=list


Usage
The placement of application files are based on different perspective

Designer Perspective

  • Theme Designer
  • Module Template Designer

Developer Perspective

  • Module Developer
  • Business Logic Developer
  • Application Library Developer

Project Manager Perspective

  • Project Manager (or) Team Leader

Theme Designer
Files are placed inside the "Application Root/themes/Your Theme" directory.

Module Templace Designer
Files are placed in either "Application Root/workplace" directory (or) "Application Root/modules/Your Module" directory

Module Developer
Files are placed in "Application Root/modules/Your Module" directory

Business Logic Developer
Files are placed in "Application Root/businessmodules/Your Business Module" directory

Application Library Developer
Files are placed in either "Application Root/utils.php" (or) "Application Root/librarymodules/Your Business Module" directory

Project Manager (or) Team Leader
Files are placed in either "Application Root/ClsConfig.php" (or) "Application Root/modules/Your Module/config.php" file


Flow of control
When a request is made from URL,
Assume URL's page parameter is $page
Assume URL's action parameter is $action
Priority 1) If the file named as {$page}_{$action}.php exist in workplace, it will be used
Priority 2) If the file named as $page.php exist in workplace, it will be used
Priority 3) If controller class(Cls{$page - First Letter Is Capital}) exist, the method (related to URL's action parameter) will be triggered and then go to {$action}.php (or) {$page).php
Priority 4) If the file named as {$action}.php exist it will be used
Priority 5) If the file named as {$page).php exist it will be used

Ex: if the module name is "test" and action is "myact"

the controller class is "ClsTest"

the file name has to be "ClsTest.php"

There must be a action method inside the ClsTest.php

i.e

class ClsTest
{
public function myact()
{
return array("key1"=>"val1","key2"=>"val2");
}
}

the template files is "test_myact.php"

if there is no action specified in the url, the "test_create.php" will be picked.

Now two variables key1 and key2 from the myact method, is available to test_myact.php.

If the test_myact.php has following code,


echo $key1;
echo ",";
echo $key2;
?>




The output will be

val1,val2 (see the myact method inside the ClsTest class

The frame work has 5 Entity Types

  • Contoller Class
    It is the entry point for a module. This class contains methods in the name of action param.
  • Wrapper Class
    It is the interface of database table.
  • Library Class
    Library class.
  • Library Functions
    Aplication Function
    Module Fucntion
  • Template
    Theme Files Template Files

[Application Input]
[Application Output]

[Controller]
[Wrapper]
[DBTable]
[Template]
[Themes]
[Library Class]
[Library Function]

[FAQ]
[sections of Development]

[Standard To Follow]
[Module]

Project Admins:


Related

Wiki: Application Input
Wiki: Application Output
Wiki: Controller
Wiki: DBTable
Wiki: FAQ
Wiki: Module
Wiki: Standard To Follow
Wiki: Template
Wiki: Themes
Wiki: Wrapper
Wiki: sections of Development

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.