Download the PHP package spinalcord/square-routing without Composer

On this page you can find all versions of the php package spinalcord/square-routing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package square-routing

SquareRouting

SquareRouting (Approx 0.35 Mb without comments) is a powerful, fast, and flexible PHP MVC micro-framework designed to provide a robust foundation for building web applications. It emphasizes clean URL structures, efficient routing, and includes essential features like rate limiting, caching, and a built-in account system. Leave a ⭐if you like this project.

Table of Contents

Features

This project uses Composer for dependency management.

  1. Clone the repository:

  2. Or with Composer:

Usage

Core Concepts

Defining Routes

Create your routes in backend/Routes/ApplicationRoutes.php. Here's how to add different types of routes:

Validator-Based Route Parameters

SquareRouting uses modern validator objects instead of regex patterns for route parameter validation. This provides better type safety and reusability.

Available Built-in Validators:

Usage Examples:

Creating Custom Validators:

Benefits over Regex Patterns:

Route Collection

Use RouteCollector to combine routes from different sources. This is useful for modular applications or plugin systems:

Controllers

Controllers handle your application logic. They get the DependencyContainer automatically:

Route Filters

Filters let you run code before and after your routes. Great for authentication or logging:

Apply filters to your routes:

Built-in Features

CORS Protection

Set allowed domains in your .env file:

Leave empty to allow all origins.

Caching

Cache expensive operations easily:

Rate Limiting

Protect your API from abuse:

Environment Variables (.env)

Access your environment variables:

Input Validation

Validate user input with simple rules:

Database Operations

Simple database operations. Ensures compatiblity with sqlite and mysql.

Account System

Built-in user authentication (Needs a database connection, use sqlite in the .env if you don't have mysql ready):

ORM-like Table Generation

Define your database schema with PHP objects, ensures compatiblity between Sqlite and Mysql:

Template Engine (Views)

Render HTML templates with a Twig-like syntax:

Template file (backend/Templates/homepage.tpl):

Language Support

then do $this->language->setLanguage($lang, true); in your controller. Done.

and load it like this in php:

Configuration System

Manage super fast cached application settings in your database easily (Use sqlite in the .env if you don't have mysql ready):

Response Handling

HTML Page Example

Return simple HTML pages:

Redirection Example

Redirect users to other pages:

Run the Server

Start the built-in PHP server:

Then visit http://localhost:8000 in your browser.

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of square-routing with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spinalcord/square-routing contains the following files

Loading the files please wait ...