当前位置: 首页>>代码示例>>PHP>>正文


PHP Bootstrap::label方法代码示例

本文整理汇总了PHP中Bootstrap::label方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::label方法的具体用法?PHP Bootstrap::label怎么用?PHP Bootstrap::label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bootstrap的用法示例。


在下文中一共展示了Bootstrap::label方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getReportLinks

 /**
  * Get reports links
  * @return multitype:string
  */
 public static function getReportLinks()
 {
     $user = Session::get('user');
     $newStackTraces = isset($user['stats']) ? $user['stats']['new_stack_traces'] : 0;
     if ($newStackTraces > 0) {
         $newStacks = ' ' . Bootstrap::label($newStackTraces)->color('red');
     } else {
         $newStacks = '';
     }
     return array(Url::href('stack-traces') => 'Stack Traces' . $newStacks, Url::href('brands') => 'Brand reports', Url::href('packages') => 'Package reports', Url::href('os-versions') => 'OS version reports', Url::href('countries') => 'Country reports', Url::href('providers') => 'Provider reports');
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:15,代码来源:Menu.php

示例2: indexAjax

 public function indexAjax()
 {
     return BootstrapUI::tableRemoteResponse()->search(array('summary'))->column('id', function ($value, $row) {
         $user = \Session::get('user');
         $previousLogin = $user['previous_login'];
         return $row['created_at'] >= $previousLogin ? "{$value} " . \Bootstrap::label('NEW')->color('red') : $value;
     })->column('summary', function ($value, $row) {
         return "<pre class=\"text-danger\">{$value}</pre>";
     })->column('total', function ($value, $row) {
         $search = \Bootstrap::anchor(\Bootstrap::icon('search'), \Koldy\Url::href('reports', 'search', array('stack_trace_id' => $row['id'])))->title('Find reports with this stack trace')->asButton()->size('xs')->color('red');
         $open = \BootstrapUI::buttonRemote(\Bootstrap::icon('eye-open'))->progressText(\Bootstrap::icon('zoom-in'))->param('stack_trace_id', $row['id'])->url(\Koldy\Url::href('stack-traces', 'find-any'))->size('xs')->color('green');
         return "<p class=\"text-right\">{$value}</p>{$search} {$open}";
     })->resultSet(Stack\Trace::resultSet())->handle();
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:14,代码来源:StackTracesController.php

示例3: stackTracesAjax

 public function stackTracesAjax()
 {
     $osVersionId = (int) Input::post('os_version_id');
     if ($osVersionId <= 0) {
         Application::throwError(400, 'Bad request');
     }
     $resultSet = new Stack\Trace\ResultSet\OsVersion();
     $resultSet->setOsVersionId($osVersionId);
     return BootstrapUI::tableRemoteResponse()->primaryKey('stack_trace_id')->column('total', function ($value, $row) {
         return \Bootstrap::label($value)->color('red');
     })->column('summary', function ($value, $row) {
         return "<pre class=\"text-danger\">{$value}</pre>";
     })->column('action', function ($value, $row) use($osVersionId) {
         return \Bootstrap::anchor(\Bootstrap::icon('search'), \Koldy\Url::href('reports', 'search', array('os_version_id' => $osVersionId, 'stack_trace_id' => $row['stack_trace_id'])))->title('Find reports with this os_version and package')->asButton()->size('xs')->color('red');
     })->resultSet($resultSet)->handle();
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:16,代码来源:OsVersionsController.php

示例4: versionsAjax

 public function versionsAjax()
 {
     $packageId = (int) Input::post('package_id');
     if ($packageId <= 0) {
         Application::throwError(400, 'Bad request');
     }
     $resultSet = new Package\ResultSet\Version();
     $resultSet->setPackageId($packageId, Input::post('last'));
     $timeFrom = $resultSet->getFromTime();
     return BootstrapUI::tableRemoteResponse()->primaryKey('package_version_id')->column('total', function ($value, $row) {
         return \Bootstrap::label($value)->color('red');
     })->column('name')->column('action', function ($value, $row) use($packageId, $timeFrom) {
         return \Bootstrap::anchor(\Bootstrap::icon('search'), \Koldy\Url::href('reports', 'search', array('package_version_id' => $row['package_version_id'], 'date_from' => \Misc::userDate('Y-m-d H:i:s', strtotime($timeFrom)))))->title('Find reports with this package version')->asButton()->size('xs')->color('red');
     })->resultSet($resultSet)->handle();
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:15,代码来源:PackagesController.php

示例5: viewAction

 public function viewAction()
 {
     $id = Url::getVar(1);
     // todo: ubaciti ovo u cache i odatle cupat van
     $cacheKey = "report-{$id}";
     $crash = CrashArchive::fetchOne($id);
     if ($crash === false) {
         Application::throwError(404, 'Can not find crash report ' . $id);
     }
     $title = "Crash Report #{$id}";
     $content = array();
     $panel = Bootstrap::panel($title)->color('blue')->addHeaderElement(Bootstrap::button('Back')->setAttribute('onclick', 'window.history.back()')->color('red')->size('xs'));
     $table = Bootstrap::table();
     $table->column('id', '')->column('value', '');
     // time
     $table->row(array('id' => 'time', 'value' => Misc::userDate('Y-m-d H:i:s', $crash->created_at) . ' (' . $this->user['timezone'] . ')'));
     // package
     $e = $crash->getPackage();
     $v = $crash->getPackageVersion();
     $table->row(array('id' => 'package and version', 'value' => implode(' ', array($e !== null ? "{$this->getSearchLink('package_id', $e->id, $e->name)} {$this->getLabel($e->total)}" : 'unknown', $v !== null ? "{$this->getSearchLink('package_version_id', $v->id, $v->value)} {$this->getLabel($v->total)}" : 'unknown'))));
     // device
     $value = '';
     $e = $crash->getBrand();
     if ($e === null) {
         $value .= 'unknown brand<br/>';
     } else {
         $value .= "{$this->getSearchLink('brand_id', $e->id, $e->name)} {$this->getLabel($e->total)}<br/>";
     }
     $e = $crash->getPhoneModel();
     if ($e === null) {
         $value .= 'unknown phone model<br/>';
     } else {
         $value .= "{$this->getSearchLink('model_id', $e->id, $e->name)} {$this->getLabel($e->total)}<br/>";
     }
     $table->row(array('id' => 'device', 'value' => substr($value, 0, -5)));
     // product
     $e = $crash->getProduct();
     if ($e !== null) {
         $table->row(array('id' => 'product name', 'value' => "{$this->getSearchLink('product_id', $e->id, $e->name)} {$this->getLabel($e->total)}"));
     }
     // os
     $e = $crash->getOsVersion();
     $table->row(array('id' => 'OS', 'value' => $e === null ? 'unknown' : "{$this->getSearchLink('os_version_id', $e->id, "{$e->os} {$e->name}")} {$this->getLabel($e->total)}"));
     // user comment
     if ($crash->user_comment !== null && trim($crash->user_comment) != '') {
         $table->row(array('id' => 'user comment', 'value' => $crash->user_comment));
     }
     // user email
     if ($crash->user_email !== null && trim($crash->user_email) != '') {
         $table->row(array('id' => 'user email', 'value' => $crash->user_email));
     }
     // app lifetime
     if ($crash->user_app_start_date !== null && $crash->user_crash_date !== null) {
         $table->row(array('id' => 'app lifetime', 'value' => "{$crash->user_app_start_date}<br/>{$crash->user_crash_date} (duration: {$this->duration($crash->user_app_start_date, $crash->user_crash_date)})"));
     }
     // memory usage
     $table->row(array('id' => 'available / total memory size', 'value' => Convert::bytesToString($crash->available_mem_size) . ' / ' . Convert::bytesToString($crash->total_mem_size)));
     // country
     if ($crash->country_id !== null) {
         $country = Country::fetchOne($crash->country_id);
         $table->row(array('id' => 'country', 'value' => "<img src=\"" . Url::link("img/flag/{$country->tld}.png") . "\" /> <a href=\"" . Url::href('reports', 'search', array('country_id' => $crash->country_id)) . "\">{$country->country} (" . strtoupper($country->tld) . ")</a> " . Bootstrap::label($country->total)->color('red')));
     }
     // provider
     if ($crash->provider_id !== null) {
         $e = Provider::fetchOne($crash->provider_id);
         $table->row(array('id' => 'internet provider', 'value' => "{$this->getSearchLink('provider_id', $e->id, $e->name)} {$this->getLabel($e->total)}"));
     }
     $metas = $crash->getMetas();
     $toTabs = array();
     foreach ($metas as $key => $value) {
         if ($key != 'stack_trace') {
             if (strpos(trim($value), "\n") === false) {
                 $table->row(array('id' => str_replace('_', ' ', $key), 'value' => trim($value) == '' ? '<em>empty</em>' : $value));
             } else {
                 $toTabs[] = $key;
             }
         }
     }
     $toTabsUnknown = array();
     $unknownMetas = $crash->getUnknownMetas();
     foreach ($unknownMetas as $key => $value) {
         if (strpos(trim($value), "\n") === false) {
             $table->row(array('id' => str_replace('_', ' ', $key), 'value' => (trim($value) == '' ? '<em>empty</em>' : $value) . ' ' . Bootstrap::label('unknown meta')->color('lightblue')));
         } else {
             $toTabsUnknown[] = $key;
         }
     }
     if ($crash->stack_trace_id !== null) {
         $table->row(array('id' => 'find reports with this stack trace', 'value' => Bootstrap::anchor(\Bootstrap::icon('search'), Url::href('reports', 'search', array('stack_trace_id' => $crash->stack_trace_id)))->asButton()->color('red')->size('xs')));
     }
     $panel->content($table);
     $content[] = Bootstrap::row()->add(12, $panel);
     $tabs = Bootstrap::nav();
     if (isset($metas['stack_trace'])) {
         $tabs->addLink('stack trace', "<pre class=\"text-danger\">{$metas['stack_trace']}</pre>");
     } else {
         if ($crash->stack_trace_id !== null) {
             $stackTrace = Stack\Trace::fetchOne($crash->stack_trace_id);
             $tabs->addLink('stack trace summary', "<pre class=\"text-danger\">{$stackTrace->summary}</pre>");
         }
//.........这里部分代码省略.........
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:101,代码来源:ReportController.php


注:本文中的Bootstrap::label方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。