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


PHP ArrayAdapter::str方法代码示例

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


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

示例1: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $url = $params->str('url');
     $text = $params->str('text');
     $note = $params->str('note');
     if (!$url || !$text) {
         return 'Не передан url или текст';
     }
     /*
      * Если пользователь не просматривал эту страницу и это не администратор - игнорируем.
      */
     /*
      $wasOpened = PageOpenWatcher::isPageOpenedByUser($url, PsUser::instOrNull());
      if (!$wasOpened && !AuthManager::isAuthorizedAsAdmin()) {
      return 'Пользователь не открывал страницу'; //---
      }
     */
     $text = UserInputTools::safeShortText($text);
     $note = $note ? UserInputTools::safeLongText($note) : $note;
     $saved = UtilsBean::inst()->saveMisprint($url, $text, $note, AuthManager::getUserIdOrNull());
     if (!$saved) {
         return 'Запись не была сохранена';
         //---
     }
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:26,代码来源:Misprint.php

示例2: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $unique = $params->str(DiscussionController::JS_DATA_UNIQUE);
     $upDown = $params->bool(DiscussionController::JS_DATA_UPDOWN);
     $entity = $params->str(DiscussionController::JS_DATA_THREAD);
     $theme = $params->str(self::JS_PARAM_THEME);
     $comment = $params->str(self::JS_PARAM_COMMENT);
     $parentId = $params->int(self::JS_PARAM_PARENT_ID);
     $controller = Handlers::getInstance()->getDiscussionController($unique);
     //Валидируем тему
     if (!$parentId && $controller->getDiscussionSettings()->isThemed()) {
         if (!$theme) {
             return 'Введите тему';
         }
         $error = UserInputValidator::validateShortText($theme);
         if ($error) {
             return $error;
         }
         $theme = UserInputTools::safeShortText($theme);
     }
     //Валидируем комментарий
     if (!$comment) {
         return 'Введите комментарий';
     }
     $error = UserInputValidator::validateLongText($comment);
     if ($error) {
         return $error;
     }
     $comment = UserInputTools::safeLongText($comment);
     $msgObj = $controller->saveMessage($entity, $parentId, $comment, $theme, PsUser::inst());
     if (!$msgObj instanceof DiscussionMsg) {
         return 'Ошибка добавления сообщения';
     }
     return new AjaxSuccess($controller->buildLeaf($msgObj));
 }
开发者ID:ilivanoff,项目名称:www,代码行数:35,代码来源:DiscussionAddMsg.php

示例3: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $fav = $params->bool('fav');
     $type = $params->str('type');
     $ident = $params->str('ident');
     PopupPagesManager::inst()->toggleUserPopup($fav, $type, $ident);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:8,代码来源:PopupFavorites.php

示例4: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $ftype = $params->str('ftype');
     $fsubtype = $params->str('fsubtype');
     $fident = $params->str('fident');
     $zip = Handlers::getInstance()->getFolding($ftype, $fsubtype)->export2zip($fident);
     if (!$zip->isFile()) {
         return 'Не удалось создать архив';
     }
     return new AjaxSuccess($zip->getRelPath());
 }
开发者ID:ilivanoff,项目名称:www,代码行数:11,代码来源:ExportFoldingZip.php

示例5: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $ftype = $params->str('ftype');
     $fsubtype = $params->str('fsubtype');
     $fident = $params->str('fident');
     $zip = FoldedStorageInsts::byTypeStype($ftype, $fsubtype)->export2zip($fident);
     if (!$zip->isFile()) {
         return 'Не удалось создать архив';
     }
     return new AjaxSuccess($zip->getRelPath());
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:11,代码来源:ExportFoldingZip.php

示例6: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $action = $params->str('action');
     switch ($action) {
         case 'saveIni':
             ConfigIni::saveIniContent($params->str('scope'), $params->str('content'));
             break;
         default:
             raise_error("Неизвестный тип действия: [{$action}]");
     }
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:12,代码来源:ConfigFilesSave.php

示例7: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $name = $params->str('name');
     $type = $params->str('type');
     $ident = $params->str('ident');
     $rubId = $params->int('rubId');
     check_condition($name, 'Name is empty');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($type);
     $pp->getFolding()->assertExistsEntity($ident);
     AdminPostsBean::inst()->registerPost($pp->dbBean(), $ident, $name, $rubId);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:12,代码来源:PostEditAction.php

示例8: doProcess

 public function doProcess(ArrayAdapter $params)
 {
     $postId = $params->int('postId');
     $postType = $params->str('postType');
     $this->postCP = Handlers::getInstance()->getPostsProcessorByPostType($postType)->getPostContentProvider($postId);
     check_condition(!!$this->postCP, "Not found post with id='{$postId}' for post type='{$postType}'");
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:postoriginalview.php

示例9: doProcess

 public function doProcess(ArrayAdapter $params)
 {
     $postId = $params->int('postId');
     $postType = $params->str('postType');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($postType);
     $this->postCP = $pp->getPostContentProvider($postId);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:print.php

示例10: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $lident = $params->str(self::PARAM_LIDENT);
     $eident = $params->str(self::PARAM_EIDENT);
     if ($params->bool(TIMELINE_LOADING_MARK)) {
         /*
          * Загружаем представление элемента хронологической шкалы
          */
         return new AjaxSuccess(TimeLineManager::inst()->getTimeLineItemPresentation($lident, $eident, $params));
     } else {
         /*
          * Загружаем композицию
          */
         return new AjaxSuccess(TimeLineManager::inst()->getTimeLineJson($lident, $params));
     }
 }
开发者ID:ilivanoff,项目名称:www,代码行数:16,代码来源:TimeLine.php

示例11: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $method = $params->str('method');
     $params = $params->arr('params');
     TestManagerCaller::execute($method, $params);
     return new AjaxSuccess();
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:TestAction.php

示例12: registerStock

 /**
  * Метод, вызываемый блоком
  * {stock name='Мозайка' img='puzzle.png' ident='mosaic' to='2013-12-11 12:00:00' enabled='1' data_id='1'}
  * для регистрации акции
  * 
  * @param ArrayAdapter $params - параметры акции.
  */
 public function registerStock(ArrayAdapter $params)
 {
     $type = $params->str('type');
     if (!$this->existsEntity($type)) {
         return PsHtml::divErr("Неизвестный тип акции - [{$type}].");
     }
     /*
     * TODO - выкинута проверка доступа
      if (!$this->hasAccess($type)) {
      return '';
      }
     */
     /* @var $stock BaseStock */
     $stock = $this->getEntityClassInst($type, false);
     if (!$stock->isUserHasAccess()) {
         return '';
     }
     $stock->init($params);
     $type = $stock->getType();
     $ident = $stock->getStockIdent();
     if (array_key_exists($ident, $this->STOCKS)) {
         return PsHtml::divErr("Акция [{$stock}] уже зарегистрирована.");
     }
     $this->STOCKS[$ident] = $stock;
     $this->LOGGER->info("STOCK [{$stock}] is registered.");
     /*
      * Акция успешно зарегистрирована, покажем её "короткий" вид
      */
     $PARAMS['stock'] = $stock;
     $PARAMS['body'] = $stock->getShortView();
     return PSSmarty::template('common/stock.tpl', $PARAMS)->fetch();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:39,代码来源:StockManager.php

示例13: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $action = $params->str('action');
     $unique = $params->str('unique');
     $folding = Handlers::getInstance()->getFoldingByUnique($unique);
     $res = 'OK';
     switch ($action) {
         case 'save_list':
             $list = $params->str('list');
             $data = $params->arr('data');
             $folding->saveList($list, $data);
             break;
         default:
             return 'Неизвестное действие: ' . $action;
     }
     return new AjaxSuccess($res);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:17,代码来源:FoldingAction.php

示例14: executeImpl

 protected function executeImpl(ArrayAdapter $params)
 {
     $unique = $params->str(DiscussionController::JS_DATA_UNIQUE);
     $upDown = $params->bool(DiscussionController::JS_DATA_UPDOWN);
     $entity = $params->int(DiscussionController::JS_DATA_THREAD);
     $action = $params->str(self::JS_PARAM_ACTION);
     $msgId = $params->int(self::JS_PARAM_MSG_ID);
     $rootId = $params->int(self::JS_PARAM_ROOT_ID);
     $controller = Handlers::getInstance()->getDiscussionController($unique);
     if (in_array($action, DiscussionController::getCommentActions())) {
         return new AjaxSuccess($controller->executeCommentAction($msgId, $action));
     }
     if ($action == DiscussionController::TREE_ACTION_LOAD_COMMENTS) {
         return new AjaxSuccess($controller->loadTree($rootId, $upDown, $entity));
     }
     return "Неизвестное действие: [{$action}]";
 }
开发者ID:ilivanoff,项目名称:www,代码行数:17,代码来源:DiscussionAction.php

示例15: init

 public final function init(ArrayAdapter $params)
 {
     //Стандартные параметры
     $this->name = $params->str('name', 'Акция');
     $this->isActive = $params->bool('active', true);
     $this->isByDate = $params->hasNoEmpty('to');
     if ($this->isByDate) {
         $this->secondsLeft = strtotime($params->str('to')) - time();
         $this->isActive = $this->isActive && $this->secondsLeft > 0;
     }
     //Параметры акции (только те, что начинаются с data_)
     $this->params = ArrayAdapter::inst($params->getByKeyPrefix('data_', true));
     //Полный идентификатор акции
     $this->stockIdent = $this->sign($this->params->getData());
     //Вызовем инициализацию класса-наследника
     $this->onInit($this->params);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:17,代码来源:BaseStock.php


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