File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
scripts/Phalcon/Web/Tools/Controllers Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2121
2222namespace WebTools \Controllers ;
2323
24+ use PDOException ;
2425use Phalcon \Text ;
2526use Phalcon \Builder \Scaffold ;
2627use Phalcon \Mvc \Controller \Base ;
@@ -107,10 +108,17 @@ public function generateAction()
107108 $ this ->tag ->setDefault ('templatesPath ' , $ templatesPath );
108109 $ this ->tag ->setDefault ('schema ' , $ this ->dbUtils ->resolveDbSchema ());
109110
111+ try {
112+ $ tables = $ this ->dbUtils ->listTables ();
113+ } catch (PDOException $ PDOException ) {
114+ $ tables = [];
115+ $ this ->flash ->error ($ PDOException ->getMessage ());
116+ }
117+
110118 $ this ->view ->setVars (
111119 [
112120 'page_subtitle ' => 'Generate code from template ' ,
113- 'tables ' => $ this -> dbUtils -> listTables () ,
121+ 'tables ' => $ tables ,
114122 'template_path ' => $ templatesPath ,
115123 'templateEngines ' => [
116124 'volt ' => 'Volt ' ,
You can’t perform that action at this time.
0 commit comments