示例#1
0
 /**
  * execute the action from the parsing
  *
  * @access protected
  * @param  array $action
  *
  * @throws Html2PdfException
  */
 protected function _executeAction($action)
 {
     $action['name'] = strtoupper($action['name']);
     if ($this->_firstPage && $action['name'] !== 'PAGE' && !$action['close']) {
         $this->_setNewPage();
     }
     // properties of the action
     $properties = $action['param'];
     // name of the action (old method)
     $fnc = ($action['close'] ? '_tag_close_' : '_tag_open_') . strtoupper($action['name']);
     $tagObject = $this->_getTagObject($action['name']);
     if (!is_null($tagObject)) {
         if ($action['close']) {
             $res = $tagObject->close($properties);
         } else {
             $res = $tagObject->open($properties);
         }
     } elseif (is_callable(array(&$this, $fnc))) {
         $res = $this->{$fnc}($properties);
     } else {
         throw new Html2PdfException(1, strtoupper($action['name']), $this->parsingHtml->getHtmlErrorCode($action['html_pos']));
     }
     // save the name of the action
     $this->_previousCall = $fnc;
     // return the result
     return $res;
 }
示例#2
0
 /**
  * execute the action from the parsing
  *
  * @access protected
  * @param  array $action
  *
  * @throws Html2PdfException
  */
 protected function _executeAction($action)
 {
     // name of the action
     $fnc = ($action['close'] ? '_tag_close_' : '_tag_open_') . strtoupper($action['name']);
     // parameters of the action
     $param = $action['param'];
     // if it is the first action of the first page, and if it is not an open tag of PAGE => create the new page
     if ($fnc != '_tag_open_PAGE' && $this->_firstPage) {
         $this->_setNewPage();
     }
     // the action must exist
     if (!is_callable(array(&$this, $fnc))) {
         throw new Html2PdfException(1, strtoupper($action['name']), $this->parsingHtml->getHtmlErrorCode($action['html_pos']));
     }
     // run the action
     $res = $this->{$fnc}($param);
     // save the name of the action
     $this->_previousCall = $fnc;
     // return the result
     return $res;
 }