-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.php
36 lines (33 loc) · 1.05 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Kohana 3 Ext.Direct PHP
* To quickly intergrate Ext.Direct API calls within a Kohana 3 application
*
* Ported from Ext.Direct PHP - Maintained by tommymaintz (Tommy Maintz)
* http://extjs.com/forum/showthread.php?t=68186
*
* @author Fady Khalife
*/
// Check if config is allowing examples
$config_defaults = Kohana::config('extdirect.defaults');
if($config_defaults['enable_examples'])
{
// For our examples media files
Route::set('extdirect/media', 'extdirect/media(/<file>)', array('file' => '.+'))
->defaults(array(
'controller' => 'examples',
'action' => 'media',
'file' => NULL,
));
// Examples routes
Route::set('extdirect/examples', 'extdirect/examples(/<action>)')
->defaults(array(
'controller' => 'examples',
'action' => 'index',
));
}
Route::set('default', '(<controller>(/<action>))')
->defaults(array(
'controller' => 'extdirect',
'action' => 'api',
));