承接 modularr/uri 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

modularr/uri

Composer 安装命令:

composer require modularr/uri

包简介

Single Responisibilty Uri Library

README 文档

README

Latest Version Software License Total Downloads

The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can also retrieve information about the re-routed segments.

This is a library similar to CodeIgniter URI Class, simply Instantiate the Class.

Install & Usage

composer require modularr/uri

$uri = new URI('/folder_path');

$uri = new URI($folder=null);

Folder is optional, but necessary if your project is in a subfolder.

$uri->segment(n)

Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this:

The segment numbers would be this:

http://example.com/index.php/news/local/metro/crime_is_up

  1. news
  2. local
  3. metro
  4. crime_is_up

By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, this would tell the function to return the number zero in the event of failure:

$product_id = $uri->segment(3, 0);

It helps avoid having to write code like this:

if (empty($uri->segment(3)))
{
    $product_id = 0; # if segment is empty
}
else
{
    $product_id = $uri->segment(3); # get the segment
}

$uri->uri_string()

Returns a string with the complete URI. For example, if this is your full URL:

http://example.com/index.php/news/local/345

The function would return this:

/news/local/345

$uri->total_segments()

Returns the total number of segments.

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固