Ubiquity  2.0.0
php rapid development framework
RoutesTrait.php
Go to the documentation of this file.
1 <?php
3 
4 use Ajax\JsUtils;
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,$icon="info",$timeout=NULL,$staticName=null);
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","info",4000);
29  $routes=CacheManager::getRoutes();
30  echo $this->_getAdminViewer()->getRoutesDataTable(Route::init($routes));
31  echo $this->jquery->compile($this->view);
32  }
33 
34  public function filterRoutes(){
35  $filter=$_POST["filter"];
36  $ctrls=[];
37  if(UString::isNotNull($filter)){
38  $filter=\trim($_POST["filter"]);
39  $ctrls=ControllerAction::initWithPath($filter);
40  $routes=Router::filterRoutes($filter);
41  }
42  else $routes=CacheManager::getRoutes();
43  echo $this->_getAdminViewer()->getRoutesDataTable(Route::init($routes));
44  if(\sizeof($ctrls)>0){
45  echo $this->_getAdminViewer()->getControllersDataTable($ctrls);
46  }
47  $this->addNavigationTesting();
48  echo $this->jquery->compile($this->view);
49  }
50 }
showSimpleMessage($content, $type, $icon="info", $timeout=NULL, $staticName=null)
static filterRoutes($path)
Definition: Router.php:62
static initCache(&$config, $type="all", $silent=false)