CyberGL
search in CyberGL only
1 Visitor, 0 Member logged in
Signup Activation Login

Features

We have been trying to make the programming style ideal to standard.

  • Valid XHTML 1.0
  • Valid CSS 2
  • MVC approach
  • register_globals = off ready
  • Layout by CSS
  • Basic HTML Class
  • Formage Class
  • Error message system

Layout Components

Each component has its own method to control them.

  • Three section: top-section, content and footer
  • The content section consists of two fixed column: left-column and content
  • Navigation bar on the left column
  • Main menu on the top section
  • Page title on the top section

Architecture

We are using our own architectural pattern similar to Model-View-Controller (MVC). MVC is the most used architecture in web applications.

In phpFramewerk we encapsulate data and functions (model) in classes. The data is stored in variables on the config file or in the future use of phpFramewerk it will be stored in MySQL and the classes files are stored in library folder. The presentation (view) is in CSS, javascript and HTML files.

phpFramewerk is designed to keep the code in controller files as simple as possible so that the control flows between user interface, data handling and the display responds to the user will remain ease.

Control Flows

In phpFramewerk we handle control flows as follows:
  1. The user triggered events with the user interface such as clicks or presses a button.
  2. A controller handles the request from the user interface by evaluate
    the $_GET[cmd] or $_POST[cmd] variable.
  3. The controller processes the event in a way appropriate to the user's action (this is where controller accesses the model such as Add,Read,Edit and Delete).
  4. The controller accesses the view to render an appropriate response (this is where the data from the model displayed within the HTML).
  5. The user interface waits for further events triggered by the users.

Directory Structure

After you extract the package in a folder . then you will find the structure as follows:

We put all configuration files in folder ./conf
We put all view files in folder ./view
We put all classes in folder ./library
We put all images in folder ./images
And all controller files in root ./
You can move the conf, view and library folder to non-accessible folder on your server to reduce security risk.

Configuration

When you open the config.php file the configuration should explain it self.

Application Abstraction

We combine OOP and procedural progamming style. So the application will behave based on following aspects.

  1. Structure
    The application structured as conf-object-control-view. When a controller file is executed the script will read the config first (located in folder conf). On the conf all configuration will sets and construct 2 new objects $doc-> and $frm->.
  2. Objects
    All objects were put on classes located in folder library. We currently use these 2 object (document and forms) as basic methods for all operation in the application. We will add more object in the future to provide more method as needed.
  3. Control
    In a controller file there are 3 steps.
    • Initialization (init)
      In init step you can construct additional object if needed or you can set any other parameter (e.g pagetitle or sidebar navigation).
    • Processes (proc)
      In proc step the script will do the processes by evaluate the variable
      $_GET[cmd] or $_POST[cmd]. This variable represent typically user actions.
    • View (view)
      After the control step take all necessary action to provide appropriate response parameter then the view step do the display task based on parameter given by the control step.
    This controller file responsible for user interactions. A controller file is accessible by the browser. You create a page by create a controller file. In common use one controller handle one page but you can make one controller file handle many pages.
  4. View
    All view files are located in folder view except the CSS file is located in the root. The basic file is body.php, this file is the template of the application. You need to know how the CSS script works to improve the design.

    Do not change the body.php file, changes to this file will affect the layout of the web application unless you know what you're doing.

    Actually the view folder consists of not only presentation files but also some content files which is not stored on database nor config files. The files for greetings or response could be located in here.

Tutorial

We will provide manual and tutorials in our Blog: http://cybergl.blogspot.com
Login Form
Login:
Password:
Lost Password?