Friday, February 15, 2013

Simplist Php Framework Ever.

Simple Php Framework. 

 Make this your main controller index.php page and start creating. Include your modals, in turn they request your views and page controllers. To pass id's for user etc by using index.php?page=profile&id= etc. Links too can all be passed using index.php?page= etc.
Add more pages if needed.

include('head.php');                    //head section above body tag= one or two second for members
?>
if(isset($_GET['page']))
{
  $page = ($_GET['page']);

  if($page == 'home')
  {
  include('menu.php');          //or members menus after login with a duplicate member/index.php
  include('leftmenu.php');
  include('home.php');
  include('rightmenu.php');
  include('footer.php');
  }
    if($page == 'about')
    {
    include('menu.php');
    include('leftmenu.php');
    include('about.php');
    include('rightmenu.php');
    include('footer.php');
    }
       if($page == 'policy')
       {
       include('menu.php');
       include('leftmenu.php');
       include('policy.php');
       include('rightmenu.php');
       include('footer.php');
       }
           if($page == 'signup')
           {
            include('menu.php');
            include('leftmenu.php');
            include('signup.php');
            include('rightmenu.php');
            include('footer.php');
            }
               if($page =='')
               {
               include('menu.php');
               include('leftmenu.php');
               include('home.php');
               include('rightmenu.php');
               include('footer.php');
               }

} else {
       include('menu.php');
       include('leftmenu.php');
       include('home.php');
       include('rightmenu.php');
       include('footer.php');
}
?>

1 comment:

  1. This is very dynamic and basicly simple. To create new modules just duplicate this index page and add your members section and go. This will out perform any framework and is extremely easy to build. For each page.php that requires processing script just remember to make passed Get and Post variable values to go through this controller to pass and parse each value example for post values---form action="index.php?page=theProcessPage.php" and to pass user----index.php?page=profile&id=?php echo $id ; ?> etc. Dta parsing is easy too have each page part include their needed functions and classes etc.

    ReplyDelete