Skip to content

Getting Started

Zoltan Vlasits edited this page Oct 17, 2025 · 1 revision

PHP MVC Framework Wiki

Welcome to the official documentation for the PHP MVC Framework with DataTables Server-Side Processing!

πŸ“¦ Getting Started

  • Clone the repository:
    git clone https://github.com/elightsys/PHP-MVC-03.git
  • Import the database schema:
    mysql -u your_username -p your_database_name < mysql.sql
  • Copy and edit your configuration:
    cp app/config/config.php.example app/config/config.php

βš™οΈ Configuration

  • Edit app/config/config.php with your database credentials.
  • Set a unique security key:
    define('__UNIQID__', md5(uniqid(rand(), true)));
  • Never commit real credentials to GitHub!

🚦 Routing & Controllers

  • URLs map to controllers and methods:
    /Pages/Users β†’ Pages controller, Users method
  • Example controller:
    class Pages extends Controller {
        public function Users() {
            $this->view('pages/users', $data);
        }
    }

πŸ—„οΈ Models & Database

  • All models use PDO for secure database access.
  • Example query:
    $this->db->query('SELECT * FROM users WHERE active = :active');
    $this->db->bind(':active', 1);
    $results = $this->db->resultSet();

🎨 Views & Templates

  • Views are stored in app/views/
  • Pass data to views using $this->view('viewname', $data);

πŸ“Š DataTables Integration

  • Server-side processing is built-in.
  • AJAX endpoint: /Pages/SspUsersDT
  • See the README for full DataTables setup.

πŸ” Security Best Practices

  • Use HTTPS in production.
  • All queries use prepared statements.
  • CSRF tokens are included in forms.

❓ FAQ

  • How do I add a new page?
    Create a new controller and view, then map the route.

  • How do I report a bug?
    Use the "Issues" tab and fill out the bug report template.


For more details, see the README or open an issue!