Пример #1
0
<?php

use ephFrame\core\Router, ephFrame\core\Route;
$router = Router::getInstance();
$router->addRoutes(array(new Route('/:page', array('action' => 'display', 'controller' => 'app\\controller\\Controller')), 'root' => new Route('/', array('action' => 'index', 'controller' => 'app\\controller\\Controller'))));
Пример #2
0
			color: #4C4C4C;
			padding: 1em;
			background-color: #E6E6E6;
		}
		a, a:visited {
			color: #0080FF;
		}
		h1 {
			text-shadow: 0px 1px 1px rgba(0,0,0,0.25), 0px -1px 1px rgba(255,255,255,0.25);
			color: #000;
			font-weight: bold;
			font-size: 3em;
		}
	</style>
</head>
<body>
	<div id="app">
		<div id="header">
			<h1><a href="<?php 
echo \ephFrame\core\Router::getInstance()->root;
?>
"></a></h1>
		</div>
		<div id="content">
			<?php 
echo $content;
?>
		</div>
	</div>
</body>
</html>
Пример #3
0
 public function testConcurrencyAsterisk()
 {
     $Router = new Router(array(new Route('/:controller*'), new Route('/:controller/:action')));
     $this->assertEquals(array('controller' => 'app\\controller\\UserController', 'action' => 'index'), $Router->parse(new Request(RequestMethod::GET, '/user/edit')));
     $this->assertEquals(array('controller' => 'app\\controller\\UserController', 'action' => 'index'), $Router->parse(new Request(RequestMethod::GET, '/user')));
 }