Coder Social home page Coder Social logo

lukas713.com's Introduction

Web app about my projects


Used technologies

  • PHP
  • MySql
  • Twig as template engine
  • HTML
  • PhpStorm as IDE

Description

Simple Model, View, Controller architeture that allows me to add new project into database, change's it or removes it. Users can register on page, and login ofcourse.


Specifications

d-App
    d-Controllers
    d-Models
    d-Views
    l-Config
d-Core
    l-Controller
    l-Model
    l-Router
    l-View
    l-Error
d-logs
d-public
    l-.htaccess
    l-index
    l-script
d-vendor
    d-composer

Front controller adds routes that are converted into regular expression and every route as Query String is compared with those regular expression inside Dispatcher class in match method.

`$router->add('{controller}/{action}');`
`$url = $_SERVER['QUERY_STRING'];`
`$router->dispatch($url);`

//inside dispatch()
if(!$this->match($url)){
     throw new \Exception("No route: $url found", 404);
}

If there is available class as route's first part, invoke that class and if there is souch method as second part of URL invoke that method inside class too.

//still inside dispatch()
if(!class_exists($controller)){
    throw new \Exception("Class $controller does not exists!");
}
$controllerObject = new $controller($this->params);
$action = $this->params['action'];

//invoke controllers method inside class
$controllerObject->$action($this->params);

Where specific controller calls model if necessary and renders view that is requested.

//where user is requesting for index page
`public function index(){
    View::render('Home/index.html');
}`

lukas713.com's People

Contributors

lukas713 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.