DVC - General Purpose PSR-4 Data-View-Controller

Installs: 1 281

Dependents: 3

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

v23.12.01 2024-01-12 07:11 UTC

This package is auto-updated.

Last update: 2024-04-19 00:07:48 UTC


README

PHP framework for web applications and APIs. Configured with Bootstrap, but could just as easily support others.

Getting Started

  • WSL (Windows Subsystem for Linux) is a great development environment for PHP, there some notes about installing wsl here

Install

mkdir newapp
cd newapp

create a composer.json

The application relies on the composer autoload features, this (very) basic composer.json file tells the autloader where to look for this application and installs bravedave/dvc

composer.json

{
  "require": {
    "bravedave/dvc": "*"
  },
  "autoload": {
    "psr-4": {
      "": "src/app/"
    }
  }
}

install bravedave/dvc and update runtime autoloader

note: this is the same location used in the composer.json file

composer u

Create an basic application

create a application folder

mkdir -p src/app

add an application file

file src/app/application.php

<?php

class application extends bravedave\dvc\application {

  static public function startDir() {

    return dirname(__DIR__);
  }
}

create a documentroot

this creates a documentroot and copies in a fallback file

cp -R vendor/bravedave/dvc/tests/www src

system will run

php -S localhost:8080 src/www/_mvp.php

available at http://localhost:8080

there is a tutorial here