Skip to content

Commit

Permalink
Merge pull request #1351 from phalcon/fix/#1320-scaffold-blank-page
Browse files Browse the repository at this point in the history
#1320 - Fix blank page on Scaffold form page
  • Loading branch information
Jeckerson authored Nov 3, 2019
2 parents fbc578a + d8bf344 commit 8765479
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace WebTools\Controllers;

use PDOException;
use Phalcon\Text;
use Phalcon\Builder\Scaffold;
use Phalcon\Mvc\Controller\Base;
Expand Down Expand Up @@ -107,10 +108,17 @@ public function generateAction()
$this->tag->setDefault('templatesPath', $templatesPath);
$this->tag->setDefault('schema', $this->dbUtils->resolveDbSchema());

try {
$tables = $this->dbUtils->listTables();
} catch (PDOException $PDOException) {
$tables = [];
$this->flash->error($PDOException->getMessage());
}

$this->view->setVars(
[
'page_subtitle' => 'Generate code from template',
'tables' => $this->dbUtils->listTables(),
'tables' => $tables,
'template_path' => $templatesPath,
'templateEngines' => [
'volt' => 'Volt',
Expand Down

0 comments on commit 8765479

Please sign in to comment.