Exemplo n.º 1
0
 <?php 
/**
 * Created by PhpStorm.
 * User: R.McDonald
 * Date: 3/23/2015
 * Time: 9:20 PM
 */
//======================USING OBJECT===============================
require 'Bird.php';
require 'Pigeon.php';
require 'Penguin.php';
$pigeon = new Pigeon(true, 2);
$penguin = new Penguin(true, 2);
echo 'Will Never' . '<br>';
echo $pigeon->getLegCount() . " Wats Wrong" . '<br>';
if ($pigeon->canFly()) {
    echo 'Can Fly';
}
$penguin->foo();
Exemplo n.º 2
0
    $r->get('^(' . CULTURES . ')/portfolio/c([0-9]+\\-\\S+)/([0-9]*\\-\\S*)$', 'portfolio/view/$1/$3/$2');
    // avec catégories
    $r->get('^(' . CULTURES . ')/portfolio$', 'portfolio/porfolio_list/$1');
    $r->get('^(' . CULTURES . ')/portfolio/c([0-9]+\\-\\S+)$', 'portfolio/porfolio_list/$1/$2');
    /*==========  Accounts  ==========*/
    $r->get('^' . CULTURES . '/accounts/register', array('Accounts', 'Register'));
    $r->post('^' . CULTURES . '/accounts/register-profile', array('Accounts', 'RegisterProfile'));
    $r->post('^' . CULTURES . '/accounts/create', array('Accounts', 'create'));
    /*==========  contacts  ==========*/
    $r->post('^(' . CULTURES . ')/contact/send/(:any)', 'contact/send/$2');
    /*==========  sitemap  ==========*/
    $r->get('sitemap\\.xml', "sitemap/sitemap_view");
    /*==========  pages  ==========*/
    $r->get('^(' . CULTURES . ')/(:any)', 'pages/view/$1/$2');
});
$route = Pigeon::draw();
// URI like '/en/about' -> use controller 'about'
//$route['^(en|de|fr|nl)/(.+)$'] = "$2";
/*
$route['default_controller'] = '/pages/view/fr/home';

// '/en', '/de', '/fr' and '/nl' URIs -> use default controller
$route['^('.CULTURES.')$'] = $route['default_controller'];

//admin//
$route['admin'] = 'admin/view/home';
$route['admin/view_loader/(:any)/(:any)/(:any)/(:any)'] = 'admin/view_loader/$1/$2/$3/$4';
//maintenance
//pages//
//$route['page/(:any)'] = '/page/view/$1';
//portfolio
Exemplo n.º 3
0
 public function test_parameterfy()
 {
     $this->assertEquals('some/to/string/$1', Pigeon::parameterfy('posts/(:num)', 'some/to/string'));
     $this->assertEquals('blah/blah/$1/$2/$3', Pigeon::parameterfy('books/(:num)/blah/(:any)/(:num)', 'blah/blah'));
 }
Exemplo n.º 4
0
 /**
  * Clear out the routing table
  */
 public static function clear()
 {
     self::$routes = array();
 }
Exemplo n.º 5
0
|
|	$route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
|	$route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/
$route['default_controller'] = "home";
$route['404_override'] = '';
Pigeon::map(function ($r) {
    $r->get('test', 'map/getAll');
    // contact section
    $r->get('contacts', 'api/contacts/index');
    $r->get('contacts/(:num)', 'api/contacts/getById/$1');
    $r->post('contacts/(:num)', 'api/contacts/index/$1');
    $r->put('contacts/(:num)', 'api/contacts/index/$1');
    $r->delete('contacts/(:num)', 'api/contacts/index/$1');
    $r->get('contacts/(:num)/invoices', 'api/contacts/getAllInvoicesByContactId/$1');
    $r->get('contacts/(:num)/bills', 'api/contacts/getAllBillsByContactId/$1');
    $r->get('contacts/(:num)/activities', 'api/contacts/getAllActivitiesByContactId/$1');
    $r->get('contacts/types', 'api/contacts/types');
});
// $route = Pigeon::draw();
/* End of file routes.php */
/* Location: ./application/config/routes.php */