Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bjoerne2's full-sized avatar

Björn Weinbrenner bjoerne2

View GitHub Profile
<?php
namespace Deployer;
use Exception;
require 'recipe/common.php';
// Project name
set('application', '<application>');
var XWiki=(function(c){var a=c.editors=c.editors||{};a.AutoSave=Class.create({options:{enabled:false,frequency:5,...
editors.AutoSave = Class.create({
options : {
/** Is the autosave enabled ? */
enabled: false,
/** If enabled, how frequent are the savings */
frequency: 5, // minutes
...
...
try {
foreach ($this->uri->segments as $segment) {
if (preg_match('/_controller$/', $segment)) {
show_404();
}
}
parent::_parse_routes();
} finally {
...
<?php
class MY_Router extends CI_Router {
protected function _parse_routes()
{
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['_method'])) {
$old_server_method = $_SERVER['REQUEST_METHOD'];
$_SERVER['REQUEST_METHOD'] = strtoupper($_POST['_method']);
}
try {
<input type="hidden" name="_method" value="delete">
<input type="hidden" name="_method" value="put">
$route['items']['get'] = 'items/index';
$route['items/(:num)']['get'] = 'items/show/$1';
$route['items/new']['get'] = 'items/new_item';
$route['items']['post'] = 'items/create';
$route['items/(:num)/edit']['get'] = 'items/edit/$1';
$route['items/(:num)']['put'] = 'items/update/$1';
$route['items/(:num)']['delete'] = 'items/delete/$1';
public function index()
{
}
public function show($id)
{
}
public function new_item()
{
<Directory "/Users/bjoerne/Source/codeigniter-routing">
Options FollowSymLinks Multiviews Indexes
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
DocumentRoot /Users/bjoerne/Source/codeigniter-routing/public
ServerName codeigniter-routing.bjoerne.local
</VirtualHost>