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


PHP ActionResponse::set方法代码示例

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


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

示例1: index

 public function index()
 {
     // get filter to select manufacturers of active products only
     $rootCat = Category::getRootNode();
     $f = new ARSelectFilter();
     $productFilter = new ProductFilter($rootCat, $f);
     $ids = $counts = array();
     foreach (ActiveRecordModel::getDataBySQL('SELECT DISTINCT(manufacturerID), COUNT(*) AS cnt FROM Product ' . $f->createString() . ' GROUP BY manufacturerID') as $row) {
         $ids[] = $row['manufacturerID'];
         $counts[$row['manufacturerID']] = $row['cnt'];
     }
     $f = new ARSelectFilter(new InCond(new ARFieldHandle('Manufacturer', 'ID'), $ids));
     $f->mergeCondition(new NotEqualsCond(new ARFieldHandle('Manufacturer', 'name'), ''));
     $f->setOrder(new ARFieldHandle('Manufacturer', 'name'));
     $manufacturers = ActiveRecordModel::getRecordSetArray('Manufacturer', $f);
     foreach ($manufacturers as &$manufacturer) {
         $manufacturer['url'] = $this->getManufacturerFilterUrl($manufacturer);
     }
     $this->addBreadCrumb($this->translate('_manufacturers'), '');
     $response = new ActionResponse();
     $response->setReference('manufacturers', $manufacturers);
     $response->set('counts', $counts);
     $response->set('rootCat', $rootCat->toArray());
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:25,代码来源:ManufacturersController.php

示例2: edit

 public function edit()
 {
     $newsletter = ActiveRecordModel::getInstanceById('NewsletterMessage', $this->request->get('id'), ActiveRecordModel::LOAD_DATA);
     $form = $this->getForm();
     $form->setData($newsletter->toArray());
     $form->set('users', 1);
     $form->set('subscribers', 1);
     $response = new ActionResponse('form', $form);
     $groupsArray = array_merge(ActiveRecord::getRecordSetArray('UserGroup', select()), array(array('ID' => null, 'name' => $this->translate('Customers'))));
     usort($groupsArray, array($this, 'sortGroups'));
     $response->set('groupsArray', $groupsArray);
     $newsletterArray = $newsletter->toArray();
     $text = strlen($newsletterArray['text']);
     $html = strlen($newsletterArray['html']);
     if ($text && $html) {
         $newsletterArray['format'] = self::FORMAT_HTML_TEXT;
     } else {
         if ($text) {
             $newsletterArray['format'] = self::FORMAT_TEXT;
         } else {
             if ($html) {
                 $newsletterArray['format'] = self::FORMAT_HTML;
             }
         }
     }
     $response->set('newsletter', $newsletterArray);
     $response->set('sentCount', $newsletter->getSentCount());
     $response->set('recipientCount', $this->getRecipientCount($form->getData()));
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:30,代码来源:NewsletterController.php

示例3: lastViewed

 public function lastViewed()
 {
     $response = new ActionResponse();
     $response->set('randomToken', substr(md5(time() . mt_rand(1, 9999999999)), 0, 8));
     $response->set('lastViewed', BackendToolbarItem::sanitizeItemArray(BackendToolbarItem::getUserToolbarItems(array(BackendToolbarItem::TYPE_PRODUCT, BackendToolbarItem::TYPE_USER, BackendToolbarItem::TYPE_ORDER), null, 'DESC')));
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:7,代码来源:BackendToolbarController.php

示例4: update

 /**
  *  Handles LiveCart update process
  */
 public function update()
 {
     $dir = ClassLoader::getRealPath('update') . '/' . $this->getCurrentVersion();
     if (!is_dir($dir)) {
         return new RawResponse('Update directory not found');
     }
     $progress = array();
     $errors = array();
     // load SQL dump file
     $sql = $dir . '/update.sql';
     if (file_exists($sql)) {
         try {
             Installer::loadDatabaseDump(file_get_contents($sql), true, $this->request->get('force'));
             $progress['sql'] = true;
         } catch (Exception $e) {
             $errors['sql'] = $e->getMessage();
         }
     }
     $this->application->getConfigContainer()->clearCache();
     // execute custom update code
     $code = $dir . '/custom.php';
     if (file_exists($code)) {
         ob_start();
         if (!(include $code)) {
             $errors['code'] = ob_get_contents();
         } else {
             $progress['code'] = true;
         }
         ob_end_clean();
     }
     $response = new ActionResponse();
     $response->set('progress', $progress);
     $response->set('errors', $errors);
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:38,代码来源:UpdateController.php

示例5: index

 public function index()
 {
     $response = new ActionResponse();
     $response->set('isCustomizationModeEnabled', $this->application->isCustomizationMode());
     $response->set('isTranslationModeEnabled', $this->application->isTranslationMode());
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:7,代码来源:CustomizeController.php

示例6: index

 public function index()
 {
     $response = new ActionResponse();
     $response->set('id', $this->request->get('id'));
     $response->set('ajax', $this->request->get('ajax'));
     $response->set('description', HTTPStatusException::getCodeMeaning($this->request->get('id')));
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:8,代码来源:ErrController.php

示例7: index

 public function index()
 {
     $response = new ActionResponse();
     $response->set('form', $this->getForm());
     $response->set('carts', $this->getDrivers());
     $response->set('dbTypes', array('mysql' => 'MySQL'));
     $response->set('recordTypes', LiveCartImporter::getRecordTypes());
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:9,代码来源:DatabaseImportController.php

示例8: index

 public function index()
 {
     $category = Category::getInstanceByID($this->request->get('id'), Category::LOAD_DATA);
     $types = ProductRatingType::getCategoryRatingTypes($category)->toArray();
     $response = new ActionResponse('typeList', $types);
     $response->set('form', $this->buildForm());
     $response->set('id', $this->request->get('id'));
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:9,代码来源:RatingTypeController.php

示例9: edit

 public function edit()
 {
     $group = UserGroup::getInstanceByID((int) $this->request->get('id'), true);
     $form = $this->createUserGroupForm($group);
     $response = new ActionResponse();
     $response->set('userGroup', $group->toArray());
     $response->set('userGroupForm', $form);
     $group->getSpecification()->setFormResponse($response, $form);
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:10,代码来源:UserGroupController.php

示例10: edit

 public function edit()
 {
     $tax = Tax::getInstanceByID((int) $this->request->get('id'), true);
     $form = $this->createTaxForm($tax);
     $form->setData($tax->toArray());
     $response = new ActionResponse();
     $response->set('tax', $tax->toArray());
     $response->set('taxForm', $form);
     return $this->appendTaxRates($response, $tax->getID());
 }
开发者ID:saiber,项目名称:www,代码行数:10,代码来源:TaxController.php

示例11: edit

 public function edit()
 {
     $class = ShippingClass::getInstanceByID((int) $this->request->get('id'), true);
     $form = $this->createClassForm($class);
     $form->setData($class->toArray());
     $response = new ActionResponse();
     $response->set('class', $class->toArray());
     $response->set('classForm', $form);
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:10,代码来源:ShippingClassController.php

示例12: index

 /**
  * Specification field index page
  *
  * @return ActionResponse
  */
 public function index()
 {
     $categoryID = $this->request->get('id');
     $defaultSpecFieldValues = array('ID' => $categoryID . '_new', 'name' => array(), 'description' => array(), 'handle' => '', 'values' => array(), 'rootId' => 'specField_item_new_' . $categoryID . '_form', 'type' => EavFieldCommon::TYPE_TEXT_SIMPLE, 'dataType' => EavFieldCommon::DATATYPE_TEXT, 'categoryID' => $categoryID, 'isDisplayed' => true);
     $response = new ActionResponse();
     $response->set('categoryID', $categoryID);
     $response->set('configuration', $this->getSpecFieldConfig());
     $response->set('specFieldsList', $defaultSpecFieldValues);
     $response->set('specFieldsWithGroups', $this->getParent($categoryID)->getSpecFieldsWithGroupsArray());
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:16,代码来源:EavFieldControllerCommon.php

示例13: index

 public function index()
 {
     $productID = (int) $this->request->get('id');
     $product = Product::getInstanceByID($productID, ActiveRecord::LOAD_DATA);
     $response = new ActionResponse();
     $response->set('ownerID', $productID);
     $response->set('categoryID', $product->category->get()->getID());
     $response->set('items', ProductBundle::getBundledProductArray($product));
     $currency = $this->application->getDefaultCurrency();
     $response->set('total', $currency->getFormattedPrice(ProductBundle::getTotalBundlePrice($product, $currency)));
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:12,代码来源:ProductBundleController.php

示例14: index

 public function index()
 {
     $f = new ARSelectFilter();
     $f->setOrder(new ARFieldHandle('EyeExamSchedule', 'doctorName'), 'ASC');
     $f->setOrder(new ARFieldHandle('EyeExamSchedule', 'date'), 'DESC');
     $f->setOrder(new ARFieldHandle('EyeExamSchedule', 'time'), 'ASC');
     $arrEyeSchedule = ActiveRecordModel::getRecordSetArray('EyeExamSchedule', $f);
     $response = new ActionResponse('eyeExamList', self::loadFormattedReferences($arrEyeSchedule));
     $response->set('form', $this->buildForm());
     $curDate = date("Y-m-d");
     $response->set('curDate', $curDate);
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:13,代码来源:EyeExamScheduleController.php

示例15: edit

 public function edit()
 {
     $this->loadLanguageFile('backend/Product');
     $rpp = RecurringProductPeriod::getInstanceByID((int) $this->request->get('id'), ActiveRecord::LOAD_DATA);
     $rpp = $rpp->toArray();
     $form = $this->createForm($rpp);
     $response = new ActionResponse();
     $response->set('recurringProductPeriod', $rpp);
     $response->set('form', $form);
     $response->set('periodTypes', array_map(array($this, 'translate'), RecurringProductPeriod::getAllPeriodTypes(RecurringProductPeriod::PERIOD_TYPE_NAME_PLURAL)));
     $response->set('currencies', $this->application->getCurrencyArray(true));
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:13,代码来源:RecurringProductPeriodController.php


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