<?php
    
    $c->route['mode'] = array(
        'profile' => 'profil/',
        'activation' => array(
            'mode' => 'register',
            'function' => 'view'
        ),
        'nowe' => 'home',
        'kategorie' => 'categories',
        'kontakt' => 'contact'
    );
    
    $c->route['function'] = array(
        'pokaz' => 'view',
        'kup' => 'buy',
        'szczegoly' => 'details',
        'dodaj' => 'add',
        'szukaj' => 'search',
        'alfabetycznie' => array(
            'function' => 'default',
            'where' => 'alfabetical'
        )
    );
    
    
    
    if( !empty($c->route['mode'][$c->mode]) ){
        if(is_array($c->route['mode'][$c->mode])){
            
            $c->mode = $c->route['mode'][$c->mode]['mode'];
            $c->function = $c->route['mode'][$c->mode]['function'];
            $c->where = $c->route['mode'][$c->mode]['where'];
            $c->method = $c->route['mode'][$c->mode]['method'];
            
        } else $c->mode = $c->route['mode'][$c->mode];
    }
    if( !empty($c->route['function'][$c->function]) ){
        
        if( is_array($c->route['function'][$c->function]) ){

            if(!empty($c->route['function'][$c->function]['function']))$c->function = $c->route['function'][$c->function]['function'];
            if(!empty($c->route['function'][$c->function]['where'])) $c->where = $c->route['function'][$c->function]['where'];
            if(!empty($c->route['function'][$c->function]['method']))$c->method = $c->route['function'][$c->function]['method'];
            
        } else $c->function = $c->route['function'][$c->function];
    }

?>