PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Ali Sharifi  >  MVC 4 Dummies  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Auxiliary data
Class: MVC 4 Dummies
Web development PHP MVC framework
Author: By
Last change:
Date: 7 years ago
Size: 622 bytes
 

Contents

Class file image Download

PHP MVC 4 Dummies

A Simple PHP MVC Framewok

make Hello World

edit /routes.php

Router::get("/","HomeController","index");

in /controllers make HomeController.php

class HomeController extends BaseController
{
      public function index(){
          $this->templateEngine->assign('greeting','hello world');
          $this->templateEngine->display('home.tpl');
      }  
}

in /views/templates make home.tpl

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>hello world</title>
</head>
<body>
    <h1>{$greeting}</h1>
</body>
</html>

For more information send a message to info at phpclasses dot org.