Ubiquity  2.0.3
php rapid development framework
RoutesTrait.php
Go to the documentation of this file.
1 <?php
3 
11 
17  abstract public function _getAdminData();
18  abstract public function _getAdminViewer();
19  abstract public function _getAdminFiles();
20  abstract protected function addNavigationTesting();
21  abstract protected function showSimpleMessage($content,$type, $title=null,$icon="info",$timeout=NULL,$staticName=null):HtmlMessage;
22 
23  public function initCacheRouter(){
24  $config=Startup::getConfig();
25  \ob_start();
26  CacheManager::initCache($config,"controllers");
27  $message=\ob_get_clean();
28  echo $this->showSimpleMessage(\nl2br($message), "info","Router cache","info",4000);
29  $routes=CacheManager::getRoutes();
30  echo $this->_getAdminViewer()->getRoutesDataTable(Route::init($routes));
31  $this->addNavigationTesting ();
32  echo $this->jquery->compile($this->view);
33  }
34 
35  public function filterRoutes(){
36  $filter=$_POST["filter"];
37  $ctrls=[];
38  if(UString::isNotNull($filter)){
39  $filter=\trim($_POST["filter"]);
40  $ctrls=ControllerAction::initWithPath($filter);
41  $routes=Router::filterRoutes($filter);
42  }
43  else $routes=CacheManager::getRoutes();
44  echo $this->_getAdminViewer()->getRoutesDataTable(Route::init($routes));
45  if(\sizeof($ctrls)>0){
46  echo $this->_getAdminViewer()->getControllersDataTable($ctrls);
47  }
48  $this->addNavigationTesting();
49  echo $this->jquery->compile($this->view);
50  }
51 }
showSimpleMessage($content, $type, $title=null, $icon="info", $timeout=NULL, $staticName=null)
static filterRoutes($path)
Definition: Router.php:63
static initCache(&$config, $type="all", $silent=false)