diff --git a/src/Commands/CreateLayoutCommand.php b/src/Commands/CreateLayoutCommand.php index b8082b6..815b091 100644 --- a/src/Commands/CreateLayoutCommand.php +++ b/src/Commands/CreateLayoutCommand.php @@ -73,25 +73,49 @@ protected function execute(InputInterface $input, OutputInterface $output) '4.2.0/css/font-awesome.min.css' ]; + $fontAwesome = ! is_dir('bower_components/font-awesome') + ? system('bower install font-awesome') + : TRUE; + + if ($fontAwesome) { + $data['styleSheets'][0] = ''; + } + if ($input->getOption('bootstrap')) { $data['bootstrapContainer'] = 'container'; - - array_push( - $data['styleSheets'], - 'https://maxcdn.bootstrapcdn.com/bootstrap/' . - '3.2.0/css/bootstrap.min.css' - ); - array_push( - $data['scripts'], - 'https://code.jquery.com/jquery-2.1.1.min.js' - ); + $bootstrapCss = 'https://maxcdn.bootstrapcdn.com/bootstrap/' . + '3.2.0/css/bootstrap.min.css'; - array_push( - $data['scripts'], - 'https://maxcdn.bootstrapcdn.com/bootstrap/' . - '3.2.0/css/bootstrap.min.js' - ); + $bootstrapJs = 'https://maxcdn.bootstrapcdn.com/bootstrap/' . + '3.2.0/css/bootstrap.min.js'; + + $jquery = 'https://code.jquery.com/jquery-2.1.1.min.js'; + + $bower = ! is_dir('bower_components/bootstrap') + ? system('bower install bootstrap') + : TRUE; + + if ($bower) { + $bootstrapCss = ''; + + $bootstrapJs = ''; + + $jquery = ''; + } + + array_push($data['styleSheets'], $bootstrapCss); + array_push($data['scripts'], $jquery); + array_push($data['scripts'], $bootstrapJs); } if ( ! @mkdir($filePath, 0777, TRUE)) { diff --git a/src/Templates/Views/Layout/Footer.php b/src/Templates/Views/Layout/Footer.php index 2af7d52..62f4a6b 100644 --- a/src/Templates/Views/Layout/Footer.php +++ b/src/Templates/Views/Layout/Footer.php @@ -1,5 +1,5 @@ {% for script in scripts %} - + {% endfor %} session->flashdata('notification')): ?>