PHP Classes

Use a PHP Request URL Parser Class to Get the URL Parts Using the Class MI Router: Split the request URL simplify routing the request

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-05-12 (3 days ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
mirouter 1.0.0MIT/X Consortium ...5Libraries, PHP 8
Description 

Author

This class can split the request URL simplify routing the request.

It can parse the current request URI and stores the parts of the URL after splitting it to separate the parts divided by the / character.

The class provides several functions to access the URL parts:

- Get the URL parts in an array

- Get the complete URL as a single text string

- Check if the request URL matches a given route name

- Get a URL part by number, or the first part, or the last part or the part before the last

In Portuguese:

Esta classe for desenvolvida para facilitar o trabalho com URL amigável.

Picture of Mestre da Info
Name: Mestre da Info <contact>
Classes: 1 package by
Country: Brazil Brazil

Instructions

If you use the PHP composer tool, you can install this package using the following command:

composer require mestredainfo/mirouter

You can also follow the instructions to install the MI Router package using the PHP Classes site composer server or download the package files in ZIP or .tar.gz format.

Example

<?php

// Copyright (C) 2025 Murilo Gomes Julio
// SPDX-License-Identifier: MIT

// Mestre da Info
// Site: https://www.mestredainfo.com.br

use MIRouter\mirouter;

include_once(
dirname(__FILE__, 2) . '/vendor/autoload.php');

$rt = new mirouter();

echo
$rt->getPrimeiraURL() . '<br>';
echo
$rt->getPenultimaURL() . '<br>';
echo
$rt->getUltimaURL() . '<br>';
echo
'<hr>';
echo
$rt->getURLCompleta() . '<br>';


  Files folder image Files (5)  
File Role Description
Files folder imageexemplo (1 file)
Files folder imagemirouter (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (5)  /  exemplo  
File Role Description
  Accessible without login Plain text file rotas.php Example Example script

  Files folder image Files (5)  /  mirouter  
File Role Description
  Plain text file mirouter.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0