示例#1
0
 function testRenderableOuterTags()
 {
     $t = new Tag();
     $actual = $t->html([$t->head(), $t->body(a::c1ass('container'), [$t->header(['style' => 'width: 1px solid #000;'], a::id('my-header'), $t->h1('header'))], new Panel('Test', 'inside content'))]);
     $expected = '<html><head></head><body class="container"><header style="width: 1px solid #000;"' . ' id="my-header"><h1>header</h1></header><div class="panel panel-default"><div class="panel-heading">' . '<h3 class="panel-title">Test</h3></div><div class="panel-body">inside content</div></div></body></html>';
     $this->assertEquals($expected, $actual);
 }
示例#2
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";
 }
示例#3
0
文件: Layout.php 项目: maveius/solvre
 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()]);
 }