本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: index
public function index()
{
$response = new ActionResponse();
$response->set('isCustomizationModeEnabled', $this->application->isCustomizationMode());
$response->set('isTranslationModeEnabled', $this->application->isTranslationMode());
return $response;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}