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


PHP OW_ActionController::assign方法代码示例

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


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

示例1: __construct

 /**
  * @param OW_ActionController $controller
  */
 public function __construct($controller)
 {
     parent::__construct('DisplayNameSearchForm');
     $this->controller = $controller;
     $questionService = BOL_QuestionService::getInstance();
     $this->setId('DisplayNameSearchForm');
     $submit = new Submit(self::SUBMIT_NAME);
     $submit->setValue(OW::getLanguage()->text('base', 'user_search_submit_button_label'));
     $this->addElement($submit);
     $questionName = OW::getConfig()->getValue('base', 'display_name_question');
     $question = $questionService->findQuestionByName($questionName);
     $questionPropertyList = array();
     foreach ($question as $property => $value) {
         $questionPropertyList[$property] = $value;
     }
     $this->addQuestions(array($questionName => $questionPropertyList), array(), array());
     $controller->assign('displayNameQuestion', $questionPropertyList);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:21,代码来源:displayname_search_form.php

示例2: __construct

 public function __construct(OW_ActionController $controller)
 {
     parent::__construct('settings-form');
     $lang = OW::getLanguage();
     $newLogin = new CheckboxField('newLogin');
     $newLogin->setLabel($lang->text('femaleregonlymen', 'login_as_user'));
     $this->addElement($newLogin);
     $questionNameList = array('username', 'email', 'password', 'sex');
     $questionDtoList = BOL_QuestionService::getInstance()->findQuestionByNameList($questionNameList);
     $orderedQuestionList = array();
     $questionService = BOL_QuestionService::getInstance();
     $questionValueList = $questionService->findQuestionsValuesByQuestionNameList($questionNameList);
     foreach ($questionNameList as $questionName) {
         if (!empty($questionDtoList[$questionName])) {
             $orderedQuestionList[] = get_object_vars($questionDtoList[$questionName]);
         }
     }
     $this->addQuestions($orderedQuestionList, $questionValueList);
     $controller->assign('questions', $orderedQuestionList);
     $submit = new Submit('reg_fake');
     $submit->setValue($lang->text('femaleregonlymen', 'reg_fake'));
     $this->addElement($submit);
 }
开发者ID:GiperProger,项目名称:femaleregonlymen,代码行数:23,代码来源:settings_form.php

示例3: __construct

 /**
  * @param OW_ActionController $controller
  */
 public function __construct($controller)
 {
     parent::__construct('MainSearchForm');
     $this->controller = $controller;
     $questionService = BOL_QuestionService::getInstance();
     $this->setId('MainSearchForm');
     $submit = new Submit(self::SUBMIT_NAME);
     $submit->setValue(OW::getLanguage()->text('base', 'user_search_submit_button_label'));
     $this->addElement($submit);
     $questionData = OW::getSession()->get(self::FORM_SESSEION_VAR);
     if ($questionData === null) {
         $questionData = array();
         if (OW::getUser()->isAuthenticated()) {
             $data = BOL_QuestionService::getInstance()->getQuestionData(array(OW::getUser()->getId()), array('match_sex'));
             $questionData['match_sex'] = $data[OW::getUser()->getId()]['match_sex'];
             $questionData['googlemap_location']['distance'] = 50;
             OW::getSession()->set(self::FORM_SESSEION_VAR, $questionData);
         }
     }
     if (!empty($questionData['match_sex'])) {
         if (is_array($questionData['match_sex'])) {
             $questionData['match_sex'] = array_shift($questionData['match_sex']);
         } else {
             for ($i = 0; $i < 31; $i++) {
                 if (pow(2, $i) & $questionData['match_sex']) {
                     $questionData['match_sex'] = pow(2, $i);
                     break;
                 }
             }
         }
     }
     $accounts = $this->getAccountTypes();
     $accountList = array();
     foreach ($accounts as $key => $account) {
         $accountList[$key] = $account;
     }
     $keys = array_keys($accountList);
     $this->accountType = $keys[0];
     $this->matchSexValue = USEARCH_BOL_Service::getInstance()->getGenderByAccounType($this->accountType);
     if (isset($questionData['match_sex'])) {
         $accountType = USEARCH_BOL_Service::getInstance()->getAccounTypeByGender($questionData['match_sex']);
         if (!empty($accountType)) {
             $this->accountType = $accountType;
             $this->matchSexValue = $questionData['match_sex'];
         }
     }
     $questions = $questionService->findSearchQuestionsForAccountType($this->accountType);
     $mainSearchQuestion = array();
     $questionNameList = array('sex' => 'sex', 'match_sex' => 'match_sex');
     foreach ($questions as $key => $question) {
         $sectionName = $question['sectionName'];
         $questionNameList[] = $question['name'];
         $isRequired = in_array($question['name'], array('googlemap_location', 'match_sex')) ? 1 : 0;
         $questions[$key]['required'] = $isRequired;
         if ($question['name'] == 'sex' || $question['name'] == 'match_sex') {
             unset($questions[$key]);
         } else {
             $mainSearchQuestion[$sectionName][] = $question;
         }
     }
     $questionValueList = $questionService->findQuestionsValuesByQuestionNameList($questionNameList);
     $controller->assign('displayGender', false);
     if (count($accounts) > 1) {
         $this->displayAccountType = true;
         if (!OW::getUser()->isAuthenticated()) {
             $controller->assign('displayGender', true);
             $sex = new Selectbox('sex');
             $sex->setLabel(BOL_QuestionService::getInstance()->getQuestionLang('sex'));
             $sex->setRequired();
             $sex->setHasInvitation(false);
             //$accountType->setHasInvitation(false);
             $this->setFieldOptions($sex, 'sex', $questionValueList['sex']);
             if (!empty($questionData['sex'])) {
                 $sex->setValue($questionData['sex']);
             }
             $this->addElement($sex);
         } else {
             $sexData = BOL_QuestionService::getInstance()->getQuestionData(array(OW::getUser()->getId()), array('sex'));
             if (!empty($sexData[OW::getUser()->getId()]['sex'])) {
                 $sex = new HiddenField('sex');
                 $sex->setValue($sexData[OW::getUser()->getId()]['sex']);
                 $this->addElement($sex);
             }
         }
         $matchSex = new Selectbox('match_sex');
         $matchSex->setLabel(BOL_QuestionService::getInstance()->getQuestionLang('match_sex'));
         $matchSex->setRequired();
         $matchSex->setHasInvitation(false);
         //$accountType->setHasInvitation(false);
         $this->setFieldOptions($matchSex, 'match_sex', $questionValueList['sex']);
         if (!empty($questionData['match_sex'])) {
             $matchSex->setValue($questionData['match_sex']);
         }
         $this->addElement($matchSex);
     }
     $this->addQuestions($questions, $questionValueList, $questionData);
     $locationField = $this->getElement('googlemap_location');
//.........这里部分代码省略.........
开发者ID:bhushansonar,项目名称:hammu,代码行数:101,代码来源:main_search_form.php


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