Download the PHP package tsirosgeorge/semantic without Composer
On this page you can find all versions of the php package tsirosgeorge/semantic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tsirosgeorge/semantic
More information about tsirosgeorge/semantic
Files in tsirosgeorge/semantic
Package semantic
Short Description A simple PHP framework for building web applications.
License mit
Informations about the package semantic
Semantic MVC Framework
Welcome to the Semantic MVC Framework! This project is a custom MVC framework using FastRoute for routing and is intended for internal use. It includes features like a View
class for rendering HTML views and basic authentication.
Installation
To install the Semantic MVC Framework, use Composer:
How to Use
-
Configuration
After installation, rename the file
.env.example
to.env
and add your configuration settings. -
Rendering Views
To render data in your view pages, use the
View::render
method. For example:
- The first parameter is the view page name.
- The second parameter is the data to pass to the view.
- The third parameter is the layout to use.
Inside your view files, you can use placeholders like {{your_value}}
. These placeholders will be replaced with the corresponding values from the data array you provide. Ensure that the placeholders match the keys in your data array.
Routing
When defining routes, use the following conventions:
- API Routes: Prefix API routes with
api/
. - Page Routes: Do not use a prefix for regular page routes.
- Group Routes: Use with prefix. See exmaple below.
Example
Here is an example of how routes are defined in public/index.php
:
To add protected routes, simply include 'auth'
as the last parameter in the route definition.
You can also use gropu routing with prefixes
License
This project is licensed under a MIT license agreement. The full terms of the license can be found in the LICENSE file.
Changelog
All notable changes to this project will be documented in the CHANGELOG.md file.
All versions of semantic with dependencies
vlucas/phpdotenv Version ^5.6
tracy/tracy Version ^2.10
phpmailer/phpmailer Version ^6.9