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


PHP modX::setPlaceholders方法代码示例

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


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

示例1: redirect

 /**
  * Redirect to a specified URL.
  *
  * Properties needed:
  * - redirectTo - the ID of the Resource to redirect to.
  *
  * @param array $fields An array of cleaned POST fields
  * @return boolean False if unsuccessful.
  */
 public function redirect(array $fields = array())
 {
     if (empty($this->formit->config['redirectTo'])) {
         return false;
     }
     $redirectParams = !empty($this->formit->config['redirectParams']) ? $this->formit->config['redirectParams'] : '';
     if (!empty($redirectParams)) {
         $prefix = $this->modx->getOption('placeholderPrefix', $this->formit->config, 'fi.');
         $this->modx->setPlaceholders($fields, $prefix);
         $this->modx->parser->processElementTags('', $redirectParams, true, true);
         $redirectParams = $this->modx->fromJSON($redirectParams);
         if (empty($redirectParams)) {
             $redirectParams = '';
         }
     }
     $contextKey = $this->modx->context->get('key');
     $resource = $this->modx->getObject('modResource', $this->formit->config['redirectTo']);
     if ($resource) {
         $contextKey = $resource->get('context_key');
     }
     if (!is_numeric($this->formit->config['redirectTo']) && isset($fields[$this->formit->config['redirectTo']]) && is_numeric($fields[$this->formit->config['redirectTo']])) {
         $url = $this->modx->makeUrl($fields[$this->formit->config['redirectTo']], $contextKey, $redirectParams, 'full');
     } elseif (!is_numeric($this->formit->config['redirectTo']) && substr($this->formit->config['redirectTo'], 0, 4) === "http") {
         $url = $this->formit->config['redirectTo'];
     } else {
         $url = $this->modx->makeUrl($this->formit->config['redirectTo'], $contextKey, $redirectParams, 'full');
     }
     $this->setRedirectUrl($url);
     return true;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:39,代码来源:fihooks.class.php

示例2: setFieldsAsPlaceholders

 /**
  * Sets the fields to MODX placeholders
  * @return void
  */
 public function setFieldsAsPlaceholders()
 {
     $fields = $this->dictionary->toArray();
     /* better handling of checkbox values when input name is an array[] */
     $fs = array();
     /** @var mixed $v */
     foreach ($fields as $k => $v) {
         if (is_array($v) && !isset($_FILES[$k])) {
             foreach ($v as $sk => $sv) {
                 $fs[$k . '.' . $sk] = $this->convertMODXTags($sv);
             }
             $v = $this->modx->toJSON($v);
         }
         /* str_replace to prevent showing of placeholders */
         $fs[$k] = $this->convertMODXTags($v);
     }
     $this->modx->setPlaceholders($fs, $this->config['placeholderPrefix']);
 }
开发者ID:MobiTeam,项目名称:mirfoto,代码行数:22,代码来源:firequest.class.php

示例3: redirect

 /**
  * Redirect to a specified URL.
  *
  * Properties needed:
  * - redirectTo - the ID of the Resource to redirect to.
  *
  * @param array $fields An array of cleaned POST fields
  * @return boolean False if unsuccessful.
  */
 public function redirect(array $fields = array())
 {
     if (empty($this->quip->config['redirectTo'])) {
         return false;
     }
     $redirectParams = !empty($this->quip->config['redirectParams']) ? $this->quip->config['redirectParams'] : '';
     if (!empty($redirectParams)) {
         $prefix = $this->modx->getOption('placeholderPrefix', $this->quip->config, 'fi.');
         $this->modx->setPlaceholders($fields, $prefix);
         $this->modx->parser->processElementTags('', $redirectParams, true, true);
         $redirectParams = $this->modx->fromJSON($redirectParams);
         if (empty($redirectParams)) {
             $redirectParams = '';
         }
     }
     $url = $this->modx->makeUrl($this->quip->config['redirectTo'], '', $redirectParams, 'abs');
     $this->setRedirectUrl($url);
     return true;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:28,代码来源:quiphooks.class.php

示例4: setPlaceholders

 /**
  * @param $placeholders
  * @param string $namespace
  */
 public function setPlaceholders($placeholders, $namespace = '')
 {
     $this->modx->setPlaceholders($placeholders, $namespace);
 }
开发者ID:suasti,项目名称:pdoTools,代码行数:8,代码来源:_micromodx.php


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