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


PHP Feature::get方法代码示例

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


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

示例1: plans

 /**
  * Show list of plans
  */
 public function plans()
 {
     if (!$this->ion_auth->logged_in()) {
         redirect('/auth');
     }
     $user = $this->getUser();
     $feature = new Feature();
     $plan = new Plan();
     $this->template->layout = 'layouts/customer_settings';
     $this->template->set('features', $feature->get());
     $this->template->set('plans', $plan->getActualPlansWithoutActive($user));
     $this->template->set('user', $user);
     $this->template->set('options', $this->config->config['period_qualifier']);
     $this->template->render();
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:18,代码来源:subscript.php

示例2: getCMSFields

 public function getCMSFields()
 {
     $fields = new FieldList();
     $feature = $this->Feature();
     if ($feature->exists()) {
         $fields->push(ReadonlyField::create("FeatureTitle", "Feature", $feature->Title));
         $fields->push($feature->getValueField());
     } else {
         $selected = Feature::get()->innerJoin("ProductFeatureValue", "Feature.ID = ProductFeatureValue.FeatureID")->filter("ProductFeatureValue.ProductID", Controller::curr()->currentPageID())->getIDList();
         $features = Feature::get()->filter("ID:not", $selected);
         $fields->push(DropdownField::create("FeatureID", "Feature", $features->map()->toArray()));
         $fields->push(LiteralField::create("creationnote", "<p class=\"message\">You can choose a value for this feature after saving.</p>"));
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-comparison,代码行数:15,代码来源:ProductFeatureValue.php

示例3: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Features", $grid = GridField::create("Features", "Features", $this->owner->Features(), GridFieldConfig_RecordEditor::create()));
     $grid->getConfig()->removeComponentsByType('GridFieldDataColumns')->removeComponentsByType('GridFieldAddNewButton')->addComponent(new GridFieldAddNewInlineButton())->addComponent(new GridFieldEditableColumns())->addComponent(new GridFieldOrderableRows());
     $grid->getConfig()->getComponentByType('GridFieldEditableColumns')->setDisplayFields(array('FeatureID' => function ($record, $column, $grid) {
         $dropdown = new DropdownField($column, 'Feature', Feature::get()->map('ID', 'Title')->toArray());
         $dropdown->addExtraClass('on_feature_select_fetch_value_field');
         return $dropdown;
     }, 'Value' => function ($record, $column, $grid) {
         if ($record->FeatureID) {
             $field = $record->Feature()->getValueField();
             $field->setName($column);
             return $field;
         }
         return new HiddenField($column);
     }));
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-comparison,代码行数:17,代码来源:ProductFeaturesExtension.php

示例4: index

 public function index($request)
 {
     if (!SecurityToken::inst()->checkRequest($request)) {
         return $this->httpError(403);
     }
     $id = $request->getVar('ID');
     if (!$id) {
         return $this->httpError(400);
     }
     $feature = Feature::get()->byId($id);
     if (!$feature) {
         return $this->httpError(404);
     }
     if (!$feature->canView()) {
         return $this->httpError(403);
     }
     $field = $feature->getValueField()->setName($request->getVar('Name'));
     return $field->forTemplate();
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-comparison,代码行数:19,代码来源:ProductFeatureValueFieldController.php

示例5: plans

 public function plans()
 {
     $post = $this->input->post();
     if (!empty($post)) {
         if (isset($post['planId'])) {
             $selectedPlan = $post['planId'];
             redirect('auth/register/' . $selectedPlan, 'refresh');
         }
     }
     $feature = new Feature();
     $plan = new Plan();
     $this->template->set('features', $feature->get());
     $withTrial = !$this->ion_auth->logged_in();
     CssJs::getInst()->add_js('libs/eq-height.js');
     $this->template->set('plans', $plan->getActualPlans($withTrial));
     $this->template->set('options', $this->config->config['period_qualifier']);
     $this->template->render();
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:18,代码来源:auth.php

示例6: LatestFeatures

 public function LatestFeatures($PageID)
 {
     return Feature::get()->filter(array('FeaturesPageID' => $PageID))->sort('Created', 'ASC');
 }
开发者ID:tcaiger,项目名称:mSupplyNZ,代码行数:4,代码来源:FeaturesPage.php

示例7: RoadmapList

 function RoadmapList()
 {
     $RoadmapQuery = "Roadmap = TRUE AND ProductPageID =" . $this->ID;
     $RoadmapList = Feature::get()->where($RoadmapQuery);
     return $RoadmapList;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:6,代码来源:ProductPage.php

示例8: Features

 /**
  * @return DataList
  */
 public function Features()
 {
     return Feature::get()->leftJoin("ProductFeatureValue", "\"Feature\".\"ID\" = \"ProductFeatureValue\".\"FeatureID\"")->filter("ProductID", $this->getSelectionIDs());
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-comparison,代码行数:7,代码来源:ProductComparisonPage.php


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