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


PHP HtmlDumper::setStyles方法代码示例

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


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

示例1: getDumper

 private function getDumper()
 {
     if (!$this->htmlDumper && class_exists('Symfony\\Component\\VarDumper\\Cloner\\VarCloner')) {
         $this->htmlDumperOutput = new HtmlDumperOutput();
         // re-use the same var-dumper instance, so it won't re-render the global styles/scripts on each dump.
         $this->htmlDumper = new HtmlDumper($this->htmlDumperOutput);
         $styles = array('default' => 'color:#FFFFFF; line-height:normal; font:12px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace !important; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: normal', 'num' => 'color:#BCD42A', 'const' => 'color: #4bb1b1;', 'str' => 'color:#BCD42A', 'note' => 'color:#ef7c61', 'ref' => 'color:#A0A0A0', 'public' => 'color:#FFFFFF', 'protected' => 'color:#FFFFFF', 'private' => 'color:#FFFFFF', 'meta' => 'color:#FFFFFF', 'key' => 'color:#BCD42A', 'index' => 'color:#ef7c61');
         $this->htmlDumper->setStyles($styles);
     }
     return $this->htmlDumper;
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:11,代码来源:TemplateHelper.php

示例2: dump

 /**
  * Format the given value into a human readable string.
  *
  * @param  mixed $value
  * @return string
  */
 public function dump($value)
 {
     if (class_exists('Symfony\\Component\\VarDumper\\Cloner\\VarCloner')) {
         static $dumper = null;
         // re-use the same var-dumper instance, so it won't re-render the global styles/scripts on each dump.
         if (!$dumper) {
             $dumper = new HtmlDumper();
             $styles = array('default' => '', 'num' => '', 'const' => '', 'str' => '', 'note' => '', 'ref' => '', 'public' => '', 'protected' => '', 'private' => '', 'meta' => '', 'key' => '', 'index' => '');
             $dumper->setStyles($styles);
         }
         $cloner = new VarCloner();
         return $dumper->dump($cloner->cloneVar($value));
     }
     return print_r($value, true);
 }
开发者ID:jeremycherfas,项目名称:grav-blog,代码行数:21,代码来源:TemplateHelper.php


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