Skip to content

Commit

Permalink
Update CHANGESLOG.md, README.md, and 2 more files...
Browse files Browse the repository at this point in the history
  • Loading branch information
Adinan committed Feb 1, 2021
1 parent 0d19931 commit c5715fc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGESLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 3.0.0 - 2021-02-01

### Fixed

- The Router::namespace() method was using the "namespace" reserved word. Method replaced with Router::setNamespace().



## 2.1.1 - 2020-02-10

### Fixed
- Trying to set up routers for options and patch methods were generating error.
- Tidying up the documentation and some grammar errors.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ $r->add('#products/(?<category>\d+)/(?<id>\d+)#', function($parameters)
```
<br><br>

### ::namespace($namespace)
### ::setNamespace($namespace)

Set the default namespace, so there will be no need to write the entire class name of the callback when defining the routes.

```php
// Example
$r->namespace('\MyProject\\');
$r->setNamespace('\MyProject\\');

$r->add('#home#', 'MyClass::method');
// The router will assume it refers to \MyProject\MyClass::method()
Expand Down Expand Up @@ -213,7 +213,7 @@ $r = new Router('/www/');
## Server configuration

In order for it to work, we need to rewrite the requests to the file containing our router. Below are some examples:


### Apache
Here is the example of a .htaccess for Apache:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"keywords": ["router"],
"license": "MIT",
"version": "2.1.1",
"version": "3.0.0",
"authors": [
{
"name": "Adinan Cenci",
Expand Down
2 changes: 1 addition & 1 deletion src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __get($var)
return null;
}

public function namespace($namespace)
public function setNamespace($namespace)
{
$this->defaultNamespace = $namespace;
return $this;
Expand Down

0 comments on commit c5715fc

Please sign in to comment.