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


PHP HTML2PDF_locale::get方法代码示例

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


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

示例1: Footer

 /**
  * This function is call automatically by TCPDF at the end of a page
  * It takes no parameters
  *
  * @access public
  */
 public function Footer()
 {
     // prepare the text from the tranlated text
     $txt = '';
     if ($this->_footerParam['form']) {
         $txt = HTML2PDF_locale::get('pdf05');
     }
     if ($this->_footerParam['date'] && $this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf03');
     }
     if ($this->_footerParam['date'] && !$this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf01');
     }
     if (!$this->_footerParam['date'] && $this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf02');
     }
     if ($this->_footerParam['page']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf04');
     }
     if (strlen($txt) > 0) {
         // replace some values
         $toReplace = array('[[date_d]]' => date('d'), '[[date_m]]' => date('m'), '[[date_y]]' => date('Y'), '[[date_h]]' => date('H'), '[[date_i]]' => date('i'), '[[date_s]]' => date('s'), '[[page_cu]]' => $this->getMyNumPage(), '[[page_nb]]' => $this->getMyAliasNbPages());
         $txt = str_replace(array_keys($toReplace), array_values($toReplace), $txt);
         // draw the footer
         parent::SetY(-11);
         $this->SetFont('helvetica', 'I', 8);
         $this->Cell(0, 10, $txt, 0, 0, 'R');
     }
 }
开发者ID:arleincho,项目名称:bee,代码行数:35,代码来源:myPdf.class.php

示例2: _vueHTML

        /**
         * display the content in HTML moden for debug
         *
         * @access protected
         * @param  string $contenu
         */
        protected function _vueHTML($content)
        {
            $content = preg_replace('/<page_header([^>]*)>/isU', '<hr>' . HTML2PDF_locale::get('vue01') . ' : $1<hr><div$1>', $content);
            $content = preg_replace('/<page_footer([^>]*)>/isU', '<hr>' . HTML2PDF_locale::get('vue02') . ' : $1<hr><div$1>', $content);
            $content = preg_replace('/<page([^>]*)>/isU', '<hr>' . HTML2PDF_locale::get('vue03') . ' : $1<hr><div$1>', $content);
            $content = preg_replace('/<\\/page([^>]*)>/isU', '</div><hr>', $content);
            $content = preg_replace('/<bookmark([^>]*)>/isU', '<hr>bookmark : $1<hr>', $content);
            $content = preg_replace('/<\\/bookmark([^>]*)>/isU', '', $content);
            $content = preg_replace('/<barcode([^>]*)>/isU', '<hr>barcode : $1<hr>', $content);
            $content = preg_replace('/<\\/barcode([^>]*)>/isU', '', $content);
            $content = preg_replace('/<qrcode([^>]*)>/isU', '<hr>qrcode : $1<hr>', $content);
            $content = preg_replace('/<\\/qrcode([^>]*)>/isU', '', $content);
            echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>' . HTML2PDF_locale::get('vue04') . ' HTML</title>
        <meta http-equiv="Content-Type" content="text/html; charset=' . $this->_encoding . '" >
    </head>
    <body style="padding: 10px; font-size: 10pt;font-family:    Verdana;">
' . $content . '
    </body>
</html>';
            exit;
        }
开发者ID:rzt,项目名称:lms,代码行数:30,代码来源:html2pdf.class.php

示例3: __construct

 /**
  * generate a HTML2PDF exception
  *
  * @param    int $err error number
  * @param    mixed $other additionnal informations
  * @return   string  $html optionnal code HTML associated to the error
  */
 public final function __construct($err = 0, $other = null, $html = '')
 {
     // read the error
     switch ($err) {
         case 1:
             // Unsupported tag
             $msg = HTML2PDF_locale::get('err01');
             $msg = str_replace('[[OTHER]]', $other, $msg);
             $this->_tag = $other;
             break;
         case 2:
             // too long sentence
             $msg = HTML2PDF_locale::get('err02');
             $msg = str_replace('[[OTHER_0]]', $other[0], $msg);
             $msg = str_replace('[[OTHER_1]]', $other[1], $msg);
             $msg = str_replace('[[OTHER_2]]', $other[2], $msg);
             break;
         case 3:
             // closing tag in excess
             $msg = HTML2PDF_locale::get('err03');
             $msg = str_replace('[[OTHER]]', $other, $msg);
             $this->_tag = $other;
             break;
         case 4:
             // tags closed in the wrong order
             $msg = HTML2PDF_locale::get('err04');
             $msg = str_replace('[[OTHER]]', print_r($other, true), $msg);
             break;
         case 5:
             // unclosed tag
             $msg = HTML2PDF_locale::get('err05');
             $msg = str_replace('[[OTHER]]', print_r($other, true), $msg);
             break;
         case 6:
             // image can not be loaded
             $msg = HTML2PDF_locale::get('err06');
             $msg = str_replace('[[OTHER]]', $other, $msg);
             $this->_image = $other;
             break;
         case 7:
             // too big TD content
             $msg = HTML2PDF_locale::get('err07');
             break;
         case 8:
             // SVG tag not in DRAW tag
             $msg = HTML2PDF_locale::get('err08');
             $msg = str_replace('[[OTHER]]', $other, $msg);
             $this->_tag = $other;
             break;
         case 9:
             // deprecated
             $msg = HTML2PDF_locale::get('err09');
             $msg = str_replace('[[OTHER_0]]', $other[0], $msg);
             $msg = str_replace('[[OTHER_1]]', $other[1], $msg);
             $this->_tag = $other[0];
             break;
         case 0:
             // specific error
         // specific error
         default:
             $msg = $other;
             break;
     }
     // create the HTML message
     $this->_messageHtml = '<span style="color: #AA0000; font-weight: bold;">' . HTML2PDF_locale::get('txt01', 'error: ') . $err . '</span><br>';
     $this->_messageHtml .= HTML2PDF_locale::get('txt02', 'file:') . ' ' . $this->file . '<br>';
     $this->_messageHtml .= HTML2PDF_locale::get('txt03', 'line:') . ' ' . $this->line . '<br>';
     $this->_messageHtml .= '<br>';
     $this->_messageHtml .= $msg;
     // create the text message
     $msg = HTML2PDF_locale::get('txt01', 'error: ') . $err . ' : ' . strip_tags($msg);
     // add the optionnal html content
     if ($html) {
         $this->_messageHtml .= "<br><br>HTML : ..." . trim(htmlentities($html)) . '...';
         $this->_html = $html;
         $msg .= ' HTML : ...' . trim($html) . '...';
     }
     // save the other informations
     $this->_other = $other;
     // construct the exception
     parent::__construct($msg, $err);
 }
开发者ID:roger-jb,项目名称:edeip,代码行数:89,代码来源:exception.class.php


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