コード例 #1
0
ファイル: Formatter.php プロジェクト: m1lt0n/dialog
 /**
  * Format the log message. Prepends a DateTime formatted string and the
  * log level to the message.
  *
  * Example:
  *
  * $formatter = new BaseFormatter();
  * $formatter->format(LogLevel::WARNING, 'This is a warning');
  *
  * The above returns:
  *
  * 2015-08-19 14:31 +0300 WARNING This is a warning
  *
  * @param string $level the log level
  * @param string $message the log message
  * @return string the formatted message
  *
  * @see \Dialog\Formatter\FormatterInterface::format()
  */
 public function format($level, $message)
 {
     $date = $this->dateBuilder->buildFromTime();
     $level = strtoupper($level);
     $this->templateEngine->setTemplate('{date} {level} {message}');
     $this->templateEngine->setDelimiters('{', '}');
     return $this->templateEngine->render(compact('date', 'level', 'message'));
 }
コード例 #2
0
ファイル: PaginatorCore.php プロジェクト: atudz/snapneat
 /**
  * Display paginate links with limiter as option
  * @param string $limiter
  * @return string
  */
 public function paginate($limiter = true)
 {
     /*
      * Render custom paginator
      */
     if (is_null($this->paginatorBuilder)) {
         $this->paginatorBuilder = new PaginatorBuilder($this);
     }
     return $this->paginatorBuilder->render($limiter);
 }
コード例 #3
0
 /**
  * 編集画面用のrender
  * @param unknown $app
  * @param unknown $parameters
  */
 protected function renderRegistView($app, $parameters = array())
 {
     // 商品検索フォーム
     $searchProductModalForm = $app['form.factory']->createBuilder('admin_search_product')->getForm();
     $viewParameters = array('searchProductModalForm' => $searchProductModalForm->createView());
     $viewParameters += $parameters;
     return $app->render('Recommend/View/admin/regist.twig', $viewParameters);
 }