Beispiel #1
0
 public function indexAction()
 {
     $tables = [];
     foreach ($this->src->getTableNames($this->db) as $name) {
         $tables[] = ['name' => $name, 'getUrl' => $this->getUrl("data/table/get/{$name}.{{format}}", null, true), 'columnIndexUrl' => $this->getUrl("data/column.{{format}}", ['table' => $name], true)];
     }
     return $this->view(['title' => "Table Index of {$this->dbName}", 'databaseName' => $this->dbName, 'createUrl' => $this->getUrl("data/table/create/{{name}}.{{format}}", ['database' => $this->dbName]), 'databaseGetUrl' => $this->getUrl("data/database/get/{$this->dbName}.{{format}}"), 'databaseIndexUrl' => $this->getUrl("data/database.{{format}}"), 'tables' => $tables]);
 }
 public function getAction($name = null)
 {
     if (!$name) {
         return $this->dispatchError('not-found');
     }
     $db = $this->src->getDatabase($name);
     $dbName = $db->getName();
     $exists = $db->exists();
     $tables = [];
     if ($exists) {
         foreach ($this->src->getTableNames($db) as $name) {
             $tables[] = ['name' => $name, 'getUrl' => $this->getUrl("data/table/get/{$name}.{{format}}", ['database' => $dbName])];
         }
     }
     return $this->view(['title' => "Database {$dbName} Info", 'name' => $dbName, 'exists' => $exists, 'indexUrl' => $this->getUrl('data/database.{{format}}'), 'createUrl' => $this->getUrl("data/database/create/{$dbName}.{{format}}"), 'removeUrl' => $this->getUrl("data/database/remove/{$dbName}.{{format}}"), 'tableIndexUrl' => $this->getUrl("data/table.{{format}}", ['database' => $dbName]), 'tables' => $tables]);
 }