Giter Club home page Giter Club logo

teamapp's Introduction

PHP MVC + MySQL(STARTUP)

REQUIRES MySQL DATABASE!!!
Easy way how to create PHP apps from scratch with MVC
This template use MDBootstrap 5 and jQuery ( replaceable )

TESTS

Blog -> https://github.com/dannyseiner/php-mvcc-blog
ChatApp -> Coming soon!
Cloud -> Coming soon!

SETUP

  1. Open app.ini
  2. Setup database connection
  3. Setup APP Components ( disableable )

You're ready to go :)

DATABASE FUNCTION

  • QUERY -> you can select from database with static function query($sql)
  • LoadData -> You can create function static function LoadData that will be called before CreateView() This allows to use execute() function for better print. Function is called only if exists!

CREATE VIEW & CONTROLLER

Create and view must have same name!
To access them, use the name in url (Controller/Index, View/Index, localhost/index)

Login site example:

url: localhost/php-mvcc/login

Controller/Login.php
<?php
    class Login extends Controller
    {

    }
?>
View/Login.php
<div class='container w-25'>
    <form>
        <input type='text' name='username' placeholder='username'>
        <input type='password' name='password' placeholder='*******'>
        <input type='submit' name='login' value='Login'>
    </form>
</div>

Controller:

Class must have same name as the file (Controller/Index, Class Index)
Class must have this structure:
    class {filename} extends Controller{}
No need to call any other function, it work automatically :)

View:

View file must have same name as controller file and class!
Don't use tags { html, head, body } it could brake the site.
View content is already wrapped in body tag! 

teamapp's People

Contributors

dannyseiner avatar

Watchers

 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.