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


PHP unknown_type::assign方法代码示例

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


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

示例1: getExtensionSummary

 /**
  * Render the Plugin Info
  * 
  * @param unknown_type $params
  * @param unknown_type $pObj
  */
 public function getExtensionSummary($params, &$pObj)
 {
     $data = GeneralUtility::xml2array($params['row']['pi_flexform']);
     $this->init($data);
     if (is_array($data)) {
         // PluginMode
         $firstControllerAction = array_shift(explode(';', $data['data']['sDefault']['lDEF']['switchableControllerActions']['vDEF']));
         $this->pluginMode = str_replace('->', '_', $firstControllerAction);
         // List
         $listIdentifier = $data['data']['sDefault']['lDEF']['settings.listIdentifier']['vDEF'];
         // Filter
         $filterBoxIdentifier = $data['data']['sDefault']['lDEF']['settings.filterboxIdentifier']['vDEF'];
         // Export
         $exportType = array_pop(explode('.', $data['data']['sDefault']['lDEF']['settings.controller.List.export.view']['vDEF']));
         $exportFileName = $data['data']['sDefault']['lDEF']['settings.prototype.export.fileName']['vDEF'];
         $exportFileName .= $data['data']['sDefault']['lDEF']['settings.prototype.export.addDateToFilename']['vDEF'] ? '[DATE]' : '';
         $exportFileName .= '.' . $data['data']['sDefault']['lDEF']['settings.prototype.export.fileExtension']['vDEF'];
         $exportDownloadType = 'tx_ptextlist_flexform_export.downloadtype.' . $data['data']['sDefault']['lDEF']['settings.prototype.export.downloadType']['vDEF'];
         $exportListIdentifier = $data['data']['sDefault']['lDEF']['settings.exportListIdentifier']['vDEF'];
     }
     $this->fluidRenderer->assign($this->pluginMode, true);
     $this->fluidRenderer->assign('listIdentifier', $listIdentifier);
     $this->fluidRenderer->assign('filterBoxIdentifier', $filterBoxIdentifier);
     $this->fluidRenderer->assign('exportType', $exportType);
     $this->fluidRenderer->assign('exportFileName', $exportFileName);
     $this->fluidRenderer->assign('exportDownloadType', $exportDownloadType);
     $this->fluidRenderer->assign('exportListIdentifier', $exportListIdentifier);
     $this->fluidRenderer->assign('caLabel', 'LLL:EXT:pt_extlist/Resources/Private/Language/locallang.xml:tx_ptextlist_flexform_controllerAction.' . $this->pluginMode);
     return $this->fluidRenderer->render();
 }
开发者ID:BenjaminBeck,项目名称:pt_extlist,代码行数:36,代码来源:CMSLayoutHook.php

示例2: smarty_function_sugar_replace_vars

/**
 * This function will replace fields taken from the fields variable
 * and insert them into the passed string replacing [variableName] 
 * tokens where found.
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_sugar_replace_vars($params, &$smarty)
{
    if (empty($params['subject'])) {
        $smarty->trigger_error("sugarvar: missing 'subject' parameter");
        return;
    }
    $fields = $smarty->get_template_vars('fields');
    $subject = $params['subject'];
    $matches = array();
    $count = preg_match_all('/\\[([^\\]]*)\\]/', $subject, $matches);
    for ($i = 0; $i < $count; $i++) {
        $match = $matches[1][$i];
        if (!empty($fields[$match]) && isset($fields[$match]['value'])) {
            $value = $fields[$match]['value'];
            if (isset($fields[$match]['type']) && $fields[$match]['type'] == 'enum' && isset($fields[$match]['options']) && isset($fields[$match]['options'][$value])) {
                $subject = str_replace($matches[0][$i], $fields[$match]['options'][$value], $subject);
            } else {
                $subject = str_replace($matches[0][$i], $value, $subject);
            }
        }
    }
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $subject);
        return '';
    }
    return $subject;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:36,代码来源:function.sugar_replace_vars.php

示例3: smarty_function_get_blocks

/**
 * Загружает в переменную список блоков
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_get_blocks($params, &$smarty)
{
    if (!array_key_exists('assign', $params)) {
        trigger_error("get_blocks: missing 'assign' parameter", E_USER_WARNING);
        return;
    }
    $smarty->assign($params['assign'], Engine::getInstance()->Viewer_GetBlocks());
    return '';
}
开发者ID:narush,项目名称:livestreet,代码行数:16,代码来源:function.get_blocks.php

示例4: smarty_function_json

/**
 * Позволяет транслировать данные в json
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_json($params, &$smarty)
{
    if (!array_key_exists('var', $params)) {
        $smarty->trigger_error("json: missing 'var' parameter");
        return;
    }
    $var = $params['var'];
    $_contents = json_encode($var);
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $_contents);
    } else {
        return $_contents;
    }
}
开发者ID:lifecom,项目名称:Huddlebuddle,代码行数:21,代码来源:function.json.php

示例5: smarty_function_sugar_replace_vars

/**
 * This function will replace fields taken from the fields variable
 * and insert them into the passed string replacing [variableName] 
 * tokens where found.
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_sugar_replace_vars($params, &$smarty)
{
    if (empty($params['subject'])) {
        $smarty->trigger_error("sugarvar: missing 'subject' parameter");
        return;
    }
    $fields = empty($params['fields']) ? $smarty->get_template_vars('fields') : $params['fields'];
    $subject = replace_sugar_vars($params['subject'], $fields, !empty($params['use_curly']));
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $subject);
        return '';
    }
    return $subject;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:function.sugar_replace_vars.php

示例6: smarty_function_sugar_replace_vars

/**
 * This function will replace fields taken from the fields variable
 * and insert them into the passed string replacing [variableName] 
 * tokens where found.
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_sugar_replace_vars($params, &$smarty)
{
    if (empty($params['subject'])) {
        $smarty->trigger_error("sugarvar: missing 'subject' parameter");
        return;
    }
    $fields = empty($params['fields']) ? $smarty->get_template_vars('fields') : $params['fields'];
    $lDelim = "[";
    $rDelim = "]";
    if ($params['use_curly']) {
        $lDelim = "{";
        $rDelim = "}";
    }
    $subject = $params['subject'];
    $matches = array();
    $count = preg_match_all('/\\' . $lDelim . '([^\\' . $rDelim . ']*)\\' . $rDelim . '/', $subject, $matches);
    for ($i = 0; $i < $count; $i++) {
        $match = $matches[1][$i];
        //List views will have fields be an array where all the keys are upper case and the values are jsut strings
        if (!isset($fields[$match]) && isset($fields[strtoupper($match)])) {
            $match = strtoupper($match);
        }
        $value = isset($fields[$match]) ? $fields[$match] : null;
        if (!is_null($value)) {
            if (isset($value['function']['returns']) && $value['function']['returns'] == 'html') {
                $bean = $smarty->get_template_vars('bean');
                $value = $bean->{$match};
            } else {
                if (is_array($value) && isset($value['value'])) {
                    $value = $value['value'];
                }
            }
            if (isset($fields[$match]['type']) && $fields[$match]['type'] == 'enum' && isset($fields[$match]['options']) && isset($fields[$match]['options'][$value])) {
                $subject = str_replace($matches[0][$i], $fields[$match]['options'][$value], $subject);
            } else {
                $subject = str_replace($matches[0][$i], $value, $subject);
            }
        }
    }
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $subject);
        return '';
    }
    return $subject;
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:54,代码来源:function.sugar_replace_vars.php

示例7: smarty_function_lang_load

/**
 * Загружает список языковых текстовок в шаблон
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_lang_load($params, &$smarty)
{
    if (!array_key_exists('name', $params)) {
        trigger_error("lang_load: missing 'name' parameter", E_USER_WARNING);
        return;
    }
    $aLangName = explode(',', $params['name']);
    $aLangMsg = array();
    foreach ($aLangName as $sName) {
        $aLangMsg[$sName] = Engine::getInstance()->Lang_Get(trim($sName), array(), false);
    }
    if (!isset($params['json']) or $params['json'] !== false) {
        $aLangMsg = json_encode($aLangMsg);
    }
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $aLangMsg);
    } else {
        return $aLangMsg;
    }
}
开发者ID:lunavod,项目名称:bunker_stable,代码行数:27,代码来源:function.lang_load.php

示例8: smarty_function_json

/**
 * Позволяет транслировать данные в json
 *
 * @param unknown_type $params
 * @param unknown_type $smarty
 * @return unknown
 */
function smarty_function_json($params, &$smarty)
{
    if (!array_key_exists('var', $params)) {
        trigger_error("json: missing 'var' parameter", E_USER_WARNING);
        return;
    }
    if (class_exists('Entity') && $params['var'] instanceof Entity) {
        $aMethods = null;
        if (!empty($params['methods'])) {
            $aMethods = is_array($params['methods']) ? $params['methods'] : explode(',', $params['methods']);
        }
        $var = func_convert_entity_to_array($params['var'], $aMethods);
    } else {
        $var = $params['var'];
    }
    $_contents = json_encode($var);
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $_contents);
    } else {
        return $_contents;
    }
}
开发者ID:cbrspc,项目名称:LIVESTREET-1-DISTRIB,代码行数:29,代码来源:function.json.php

示例9: assign

 /**
  *
  * description
  *
  * @param $var
  * @param $val
  * @return unknown_type
  */
 public function assign($var, $val)
 {
     $this->view->assign($var, $val);
 }
开发者ID:demental,项目名称:m,代码行数:12,代码来源:Module.php


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