-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
tuxnull edited this page May 31, 2025
·
5 revisions
Welcome to VeloFrame, a minimalist PHP framework for rapid, scalable web development. This guide will walk you through setup, project structure, and your first steps.
- PHP 7 or higher
- Apache (with mod-rewrite) or any web server that supports URL rewriting
Open your terminal and run:
git clone https://github.com/URW-CE-IT/veloframe.gitAfter cloning, your project will look like:
pages/ # Your page controllers (PHP)
templates/ # HTML templates
templates/components/ # Reusable HTML components
VeloFrame/ # Core framework code
index.php # Main entry point
.htaccess # URL rewriting rules
To enable clean URLs, use this .htaccess in your project root:
RewriteEngine On
RewriteBase /
RewriteRule ^(img|css|js)/(.*)$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rpath=$1 [QSA,L]-
Tip: Adjust
RewriteBaseif your project is in a subfolder.
For quick local testing, use PHP’s built-in server:
php -S localhost:8000 index.php- Visit http://localhost:8000 in your browser.
- For production or full URL rewriting, use Apache or a compatible server.
-
Create a new file in
pages/, e.g.HelloHandler.php:# @route /hello class HelloHandler extends DefaultPageController { public function handle() { $tpl = new VeloFrame\Template("index"); $tpl->setVariable("title", "Hello World!"); return $tpl->output(); } }
-
Add a link to
/helloin your template or visit/helloin your browser.
- Templates & Components: Learn to build dynamic UIs.
- Configuration: Tune your project settings.
- Architecture: Understand the framework flow.
- Routing: Map URLs to controllers.
- Blank page? Check file permissions and error logs.
-
404 errors? Ensure
.htaccessis present and URL rewriting is enabled. - Need help? See the FAQ or open an issue on GitHub.
Happy coding with VeloFrame! 🚴♂️