Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * Smarty Internal Plugin Compile Object Function
 4:  * Compiles code for registered objects as function
 5:  *
 6:  * @package    Smarty
 7:  * @subpackage Compiler
 8:  * @author     Uwe Tews
 9:  */
10: 
11: /**
12:  * Smarty Internal Plugin Compile Object Function Class
13:  *
14:  * @package    Smarty
15:  * @subpackage Compiler
16:  */
17: class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase
18: {
19:     /**
20:      * Attribute definition: Overwrites base class.
21:      *
22:      * @var array
23:      * @see Smarty_Internal_CompileBase
24:      */
25:     public $optional_attributes = array('_any');
26: 
27:     /**
28:      * Compiles code for the execution of function plugin
29:      *
30:      * @param  array  $args      array with attributes from parser
31:      * @param  object $compiler  compiler object
32:      * @param  array  $parameter array with compilation parameter
33:      * @param  string $tag       name of function
34:      * @param  string $method    name of method to call
35:      *
36:      * @return string compiled code
37:      */
38:     public function compile($args, $compiler, $parameter, $tag, $method)
39:     {
40:         // check and get attributes
41:         $_attr = $this->getAttributes($compiler, $args);
42:         if ($_attr['nocache'] === true) {
43:             $compiler->tag_nocache = true;
44:         }
45:         unset($_attr['nocache']);
46:         $_assign = null;
47:         if (isset($_attr['assign'])) {
48:             $_assign = $_attr['assign'];
49:             unset($_attr['assign']);
50:         }
51:         // method or property ?
52:         if (method_exists($compiler->smarty->registered_objects[$tag][0], $method)) {
53:             // convert attributes into parameter array string
54:             if ($compiler->smarty->registered_objects[$tag][2]) {
55:                 $_paramsArray = array();
56:                 foreach ($_attr as $_key => $_value) {
57:                     if (is_int($_key)) {
58:                         $_paramsArray[] = "$_key=>$_value";
59:                     } else {
60:                         $_paramsArray[] = "'$_key'=>$_value";
61:                     }
62:                 }
63:                 $_params = 'array(' . implode(",", $_paramsArray) . ')';
64:                 $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)";
65:             } else {
66:                 $_params = implode(",", $_attr);
67:                 $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})";
68:             }
69:         } else {
70:             // object property
71:             $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}";
72:         }
73: 
74:         if (empty($_assign)) {
75:             // This tag does create output
76:             $compiler->has_output = true;
77:             $output = "<?php echo {$return};?>\n";
78:         } else {
79:             $output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
80:         }
81: 
82:         return $output;
83:     }
84: }
85: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen