Skip to content

Commit 80b987a

Browse files
committed
Change route library
1 parent d4963b4 commit 80b987a

10 files changed

Lines changed: 80 additions & 62 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99

1010

1111
### Installing
12-
12+
1313
`git clone https://github.com/jaydeepakbari/Codeigniter-Admin-Panel.git`
14-
15-
![](https://img.shields.io/github/stars/pandao/editor.md.svg) ![](https://img.shields.io/github/forks/pandao/editor.md.svg) ![](https://img.shields.io/github/tag/pandao/editor.md.svg) ![](https://img.shields.io/github/release/pandao/editor.md.svg) ![](https://img.shields.io/github/issues/pandao/editor.md.svg) ![](https://img.shields.io/bower/v/editor.md.svg)

application/config/autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
|
5959
| $autoload['libraries'] = array('user_agent' => 'ua');
6060
*/
61-
$autoload['libraries'] = array();
61+
$autoload['libraries'] = array('session');
6262

6363
/*
6464
| -------------------------------------------------------------------
@@ -89,7 +89,7 @@
8989
|
9090
| $autoload['helper'] = array('url', 'file');
9191
*/
92-
$autoload['helper'] = array('url','routes');
92+
$autoload['helper'] = array('url');
9393

9494
/*
9595
| -------------------------------------------------------------------

application/config/hooks.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
|
1313
*/
1414

15+
16+
$hook = Luthier\Hook::getHooks();
1517
$hook['post_controller_constructor'][] = [
1618
'class' => 'EloquentHook',
1719
'function' => 'bootEloquent',
1820
'filename' => 'EloquentHook.php',
1921
'filepath' => 'hooks'
20-
];
22+
];

application/config/routes.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@
5151
*/
5252
$route['default_controller'] = 'welcome';
5353
$route['404_override'] = '';
54-
$route['translate_uri_dashes'] = FALSE;
54+
$route['translate_uri_dashes'] = FALSE;
55+
56+
$route = Luthier\Route::getRoutes();
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* Luthier default controller - DO NOT EDIT OR REMOVE THIS FILE!
5+
*
6+
* Because CodeIgniter checks the existence of the file/class/method of the controller
7+
* pointed in all our routes, this allows to create dynamic routes without hacking/extending
8+
* the CI_Router class.
9+
*/
10+
11+
defined('BASEPATH') OR exit('No direct script access allowed');
12+
13+
class LuthierController extends CI_Controller
14+
{
15+
/**
16+
* Luthier CI fake index method
17+
*/
18+
public function index()
19+
{
20+
}
21+
}

application/helpers/routes_helper.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

application/routes/api.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
/**
4+
* API Routes
5+
*
6+
* This routes only will be available under AJAX requests. This is ideal to build APIs.
7+
*/

application/routes/cli.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
/**
4+
* CLI Routes
5+
*
6+
* This routes only will be available under a CLI environment
7+
*/
8+
9+
// To enable Luthier-CI built-in cli commands
10+
// uncomment the followings lines:
11+
12+
// Luthier\Cli::maker();
13+
// Luthier\Cli::migrations();
14+

application/routes/web.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* Welcome to Luthier-CI!
5+
*
6+
* This is your main route file. Put all your HTTP-Based routes here using the static
7+
* Route class methods
8+
*
9+
* Examples:
10+
*
11+
* Route::get('foo', 'bar@baz');
12+
* -> $route['foo']['GET'] = 'bar/baz';
13+
*
14+
* Route::post('bar', 'baz@fobie', [ 'namespace' => 'cats' ]);
15+
* -> $route['bar']['POST'] = 'cats/baz/foobie';
16+
*
17+
* Route::get('blog/{slug}', 'blog@post');
18+
* -> $route['blog/(:any)'] = 'blog/post/$1'
19+
*/
20+
21+
Route::get('/', 'welcome@index')->name('homepage');
22+
23+
Route::set('404_override', function(){
24+
show_404();
25+
});
26+
27+
Route::set('translate_uri_dashes',FALSE);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"require": {
1414
"php": ">=5.3.7",
1515
"illuminate/database": "5.1.16",
16-
"illuminate/pagination": "~5.0"
16+
"illuminate/pagination": "~5.0",
17+
"luthier/luthier": "^1.0"
1718
},
1819
"suggest": {
1920
"paragonie/random_compat": "Provides better randomness in PHP 5.x"

0 commit comments

Comments
 (0)