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


PHP Formatter::format方法代码示例

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


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

示例1: format

 /**
  * Format the link.
  *
  * @param Link $link
  *
  * @return bool
  */
 public final function format(Link $link)
 {
     $formatted = $this->formatting($link);
     if (empty($formatted)) {
         // the link has not been formatted by this formatter, try next formatter
         if (!is_null($this->successor)) {
             $formatted = $this->successor->format($link);
         }
     }
     return $formatted;
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:18,代码来源:Formatter.php

示例2: testRootNode

    public function testRootNode()
    {
        $snippet = <<<'END'
<?php
namespace Foo\Baz; class Blorg { public function __construct() {}}
END;
        $expected = <<<'END'
<?php
namespace Foo\Baz;

class Blorg
{
    public function __construct()
    {
    }
}
END;
        $doc = Parser::parseSource($snippet);
        $this->formatter->format($doc);
        $this->assertEquals($expected, $doc->getText());
    }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:21,代码来源:Psr2FormatterTest.php

示例3: format

 /**
  * Méthode inutile ?
  */
 private function format(Formatter $formater)
 {
     return $formater->format();
 }
开发者ID:bloron,项目名称:celcatbooster,代码行数:7,代码来源:Booster.class.php

示例4: render_formatted_data

 public function render_formatted_data($data)
 {
     $formatter = new Formatter();
     echo $formatter->format($data);
 }
开发者ID:tfrommen,项目名称:testable-code,代码行数:5,代码来源:creating-real-objects.php

示例5: format

 /**
  * @param $collection
  * @param null $limit
  *
  * @return string
  */
 public function format($collection, $limit = null)
 {
     return $this->formatter->format($collection, $limit);
 }
开发者ID:pushpesh4u,项目名称:php-humanizer,代码行数:10,代码来源:Oxford.php

示例6: format

 /**
  * Returns a formatted string using the specified locale, format string,
  * and arguments.
  *
  * @param  l
  *         The {@linkplain java.util.Locale locale} to apply during
  *         formatting.  If <tt>l</tt> is <tt>null</tt> then no localization
  *         is applied.
  *
  * @param blaze\lang\String|string $format
  *         A <a href="../util/Formatter.html#syntax">format string</a>
  *
  * @param array[blaze\lang\Object] args
  *         Arguments referenced by the format specifiers in the format
  *         string.  If there are more arguments than format specifiers, the
  *         extra arguments are ignored.  The number of arguments is
  *         variable and may be zero.  The maximum number of arguments is
  *         limited by the maximum dimension of a Java array as defined by
  *         the <a href="http://java.sun.com/docs/books/vmspec/">Java
  *         Virtual Machine Specification</a>.  The behaviour on a
  *         <tt>null</tt> argument depends on the <a
  *         href="../util/Formatter.html#syntax">conversion</a>.
  *
  * @throws  IllegalFormatException
  *          If a format string contains an illegal syntax, a format
  *          specifier that is incompatible with the given arguments,
  *          insufficient arguments given the format string, or other
  *          illegal conditions.  For specification of all possible
  *          formatting errors, see the <a
  *          href="../util/Formatter.html#detail">Details</a> section of the
  *          formatter class specification
  *
  * @throws  NullPointerException
  *          If the <tt>format</tt> is <tt>null</tt>
  *
  * @return blaze\lang\String A formatted string
  *
  * @see  java.util.Formatter
  * @since  1.5
  */
 public static function format($format, $args, Locale $l = null)
 {
     $f = new Formatter($l);
     return $f->format($format, $args)->toString();
 }
开发者ID:robo47,项目名称:BlazeFramework,代码行数:45,代码来源:String.php

示例7: underline

 /**
  * @param string $output
  * @return string
  */
 public function underline($output)
 {
     return parent::format($output, "", '<u style="text-decoration: underline;">', '</u>');
 }
开发者ID:tronsha,项目名称:cerberus,代码行数:8,代码来源:FormatterHtml.php

示例8: underline

 /**
  * @param string $output
  * @return string
  */
 public function underline($output)
 {
     return parent::format($output, "", "[4m", "[24m");
 }
开发者ID:tronsha,项目名称:cerberus,代码行数:8,代码来源:FormatterConsole.php


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