Пример #1
0
 public function index()
 {
     $t = new Tag();
     echo "\n";
     echo "\n";
     echo $t->doctype($t->html(['ng-app' => 'nameApp'], [$t->head([$t->meta(['charset' => 'utf-8']), $t->title('Angular.js Example'), $t->script(['src' => 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.1/angular.min.js']), $t->script([' var nameApp = angular.module(\'nameApp\', []);
                             nameApp.controller(\'NameCtrl\', function( $scope ) {
                                 $scope.names = [\'Lary\', \'Curly\', \'Moe\'];
                                 $scope.addName = function () {
                                     $scope.names.push($scope.enteredName);
                                 }
                                 //$scope.firstName = \'John\';
                                 //
                                 //$scope.$watch(\'lastName\', function(newValue, oldValue) {
                                 //    console.log(\'new value is \' + newValue);
                                 //});
                                 //
                                 //setTimeout(function(){
                                 //    $scope.lastName = \'Smith\';
                                 //    $scope.$apply();
                                 //}, 1000);
                             });'])]), $t->body(['ng-controller' => 'NameCtrl'], [$t->ul([$t->li(['ng-repeat' => 'name in names track by $index'], ['{{name}}'])]), $t->form(['ng-submit' => 'addName()'], [$t->input(['type' => 'text', 'ng-model' => 'enteredName']), $t->input(['type' => 'submit', 'value' => 'add'])])])]));
     echo "\n";
 }
Пример #2
0
 private function head(Tag $t, $controllerName)
 {
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     return $t->head([$t->meta(a::charset('utf-8')), $t->meta(a::content('IE=Edge'), a::httpEquiv("X-UA-Compatible")), $t->meta(a::name('viewport'), a::content("width=device-width", "initial-scale=1")), $t->meta(a::name('author'), a::content('maveius')), $t->meta(a::name('description'), a::content("Bug Report and Issue Tracker System Open Source")), $t->title(trans('layout.name') . ' - ' . trans('layout.title')), $t->link(a::rel('icon'), a::type('image/png'), a::href(asset('img/favicon.png'))), $t->link(a::rel('stylesheet'), a::href(asset('css/layout.css'))), $this->getViewCss($t, $controllerName), $t->script(a::src(asset('lib/plugins/jQuery/jQuery-2.1.4.min.js'))), $t->script(a::src(asset('lib/bootstrap-3.3.6-dist/js/bootstrap.min.js'))), $this->getHeaderJs(), $this->getIEHacks()]);
 }