Skip to content

Commit

Permalink
Add Craft 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
rungta committed Jul 22, 2024
1 parent f9bcb2d commit fa9bff8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Release notes for the Router Craft CMS plugin.

## Unreleased

### Added
- Added support for Craft 5.

### Changed
- The `type` filter's value will be a single `EntryType` on Craft 5+ (it remains an array of `EntryType[]` on Craft 3, and 4).
- An `yii\base\InvalidConfigException` is thrown if the `field` filter is missing the `handle` configuration option.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ based on URL parameters. It adds a new template variable `entries` which can be
for the URL `blog/2015/01` contain blog posts published in January 2015, or for the URL
`blog/camping/2014` to show blog posts published in 2014 under the category "Camping".

[ar]:https://craftcms.com/docs/4.x/routing.html#advanced-routing-with-url-rules "Advanced Routing with URL Rules - Craft CMS Documentation"
[ar]:https://craftcms.com/docs/5.x/system/routing.html#advanced-routing-with-url-rules "Advanced Routing with URL Rules - Craft CMS Documentation"
[yii routing]:https://www.yiiframework.com/doc/guide/2.0/en/runtime-routing#named-parameters "Handling Requests: Routing and URL Creation | Yii 2.0"


Expand All @@ -73,7 +73,7 @@ In order to create URL rules that automatically build an [Entry Query][eq] based
you will need to create a `router.php` file in your config folder, adjacent to your existing
`routes.php` file.

[eq]:https://craftcms.com/docs/4.x/entries.html#querying-entries
[eq]:https://craftcms.com/docs/5.x/reference/element-types/entries.html#querying-entries


### Example
Expand Down Expand Up @@ -283,12 +283,12 @@ one URI.
Adds a date range criteria for the given year on optional param `field` (which defaults
to `postDate`).

[cat]:https://craftcms.com/docs/4.x/categories.html
[entry]:https://craftcms.com/docs/4.x/entries.html
[sec]:https://craftcms.com/docs/4.x/entries.html#sections
[tag]:https://craftcms.com/docs/4.x/tags.html
[type]:https://craftcms.com/docs/4.x/entries.html#entry-types
[search]:https://craftcms.com/docs/4.x/searching.html
[cat]:https://craftcms.com/docs/5.x/reference/element-types/categories.html
[entry]:https://craftcms.com/docs/5.x/reference/element-types/entries.html
[sec]:https://craftcms.com/docs/5.x/reference/element-types/entries.html#sections
[tag]:https://craftcms.com/docs/5.x/reference/element-types/tags.html
[type]:https://craftcms.com/docs/5.x/reference/element-types/entries.html#entry-types
[search]:https://craftcms.com/docs/5.x/system/searching.html



Expand Down Expand Up @@ -319,7 +319,7 @@ Open your terminal and run the following commands:

Requirements
------------
This plugin requires Craft CMS 3 or 4. The Craft 2 version is availabe in [the `v0` branch](https://github.com/miranj/craft-router/tree/v0).
This plugin requires Craft CMS 3, 4, or 5. The Craft 2 version is availabe in [the `v0` branch](https://github.com/miranj/craft-router/tree/v0).



Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"source": "https://github.com/miranj/craft-router"
},
"require": {
"craftcms/cms": "^3.7.0 || ^4.0",
"craftcms/cms": "^3.7.0 || ^4.0 || ^5.0",
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Router plugin for Craft CMS 3.x, 4.x
* Router plugin for Craft CMS 3.x, 4.x, 5.x
*
* Define URL rules to pages with a filtered, pre-loaded list of entries.
*
Expand Down

0 comments on commit fa9bff8

Please sign in to comment.