Skip to content

Commit f4fb2f0

Browse files
Updated readme with better example.
1 parent 6dc5e69 commit f4fb2f0

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ It does one thing only. It routs URI/URL requests (Such as: `https://example.com
66

77
## Installation
88

9-
Current version is 1.1.0
9+
Current version is 1.1.2
1010

11-
`composer require digi-brains/ya-router 1.1.1`
11+
`composer require digi-brains/ya-router 1.1.2`
1212

1313
## Overview
1414

15-
YaRouter assumes 3 things.
15+
YaRouter assumes 2 things.
1616

1717
1. You are, through your server or document root config file, directing all traffic through a single entry point/bootstrap file; such as `index.php`.
1818

19-
2. You have a directory structure for your view files that reflects your information arcitecture. [1](#allviews)
19+
2. Your views file-names reflect your URL structure. For example, If your URL is `example.com/foo/bar/my-page`, YaRouter expects to find the view for this page at `path/to/templates/foo/bar/my-page.html`. [1](#anytype).
2020

2121
Example:
2222

@@ -43,7 +43,6 @@ Example:
4343
4444
```
4545

46-
3. Your views file names reflect your URL structure. For example, If your URL is `example.com/foo/bar/my-page`, YaRouter expects to find the view for this page at `path/to/templates/foo/bar/my-page.html`. [2](#anytype)
4746

4847
## Documentation
4948

@@ -59,17 +58,17 @@ Then `use` the YaRouter\Router.
5958

6059
Just `include` the Router.php script
6160

62-
Next define your parameters:
61+
**Next define your parameters:**
6362

6463
1. `$views` This is the path to the main directory where your views are stored.
6564

6665
2. `$type` This is the _type_ of view file you are calling (extension only). E.g., .html, .php, etc...
6766

6867
3. `$default` The name of the default view file (without the extension). Typically used for home or index page.
6968

70-
Finally, create a `new Router()` object with your parameters and then call the `get_view` method.
69+
**Finally, create a** `new Router()` **object with your parameters and then call the** `get_view` **method.**
7170

72-
**Example:**
71+
### Kitchen Sink Example:
7372

7473
```
7574
(index.php)
@@ -86,7 +85,6 @@ $r = new Router( $views, $type, $default );
8685
$r->get_view();
8786
```
8887

89-
### Appendix
88+
#### Appendix
9089

91-
1. <a name="allviews"></a>_You can put all views in one single folder if you prefer._
92-
2. <a name="anytype"></a>_Your views can be any type. E.g., .htm, .html, .md, .php, etc..._
90+
1. <a name="anytype"></a>_Your views can be any type. E.g., .htm, .html, .md, .php, etc..._

0 commit comments

Comments
 (0)