Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
toitzi authored Nov 20, 2018
1 parent dbc11a0 commit fb07f38
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Koseven Subdomain Module
![License](https://img.shields.io/badge/license-BSD--3--Clause-green.svg)

This is a simple Subdomain module for Koseven, which started as a port
from jeanmasks sbdomain module for Kohana 3.x

## :sparkles: Features

* Different Routes for diffrent Subdomains

## :page_facing_up: Configuration

After enabling the module in `Kohana::modules`, set base_url to an absolute value in your bootstrap:

```
Kohana::init(array(
'base_url' => 'http://your_domain.com/',
));
```
### :clipboard: Route Examples

Let's say your base_url is "http://example.com".
The following Route will route every request to "http://example.com" and "http://www.example.com":

```
Route::$default_subdomains = array(Route::SUBDOMAIN_EMPTY, 'www');
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
```

While this Route only routes requests sent to "http://test.example.com" and "http://test2.example.com":

```
Route::set('subdomain', '(<controller>(/<action>(/<id>)))')
->subdomains(array('test', 'test2'))
->defaults(array(
'controller' => 'test',
'action' => 'index',
));
```

## :thumbsup: Special Thanks

Thanks a lot to [jeanmask](https://github.com/jeanmask)!

The module is maintained by [toitzi](https://github.com/toitzi).

## :clap: Contributing

As usual, [fork and send pull requests](https://help.github.com/articles/fork-a-repo)

## :beginner: Getting Help

* Open issues in this project.

0 comments on commit fb07f38

Please sign in to comment.