當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Term::getFutureTermsAssoc方法代碼示例

本文整理匯總了PHP中Term::getFutureTermsAssoc方法的典型用法代碼示例。如果您正苦於以下問題:PHP Term::getFutureTermsAssoc方法的具體用法?PHP Term::getFutureTermsAssoc怎麽用?PHP Term::getFutureTermsAssoc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Term的用法示例。


在下文中一共展示了Term::getFutureTermsAssoc方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: plugInternship

 /**
  * Loads the form's fields with the internship's information.
  * TODO: Use getter methods instead of just accessing Internship member variables directly.
  */
 public function plugInternship()
 {
     $this->plugStudent();
     $this->plugDept();
     $this->plugFaculty();
     $this->plugAgency();
     $this->plugInternInfo();
     $this->plugCourseInfo();
     // We're editing an internship...
     // If this internship's term is in the past, then replace the term list with just that term
     if (!in_array($this->intern->term, array_keys(Term::getFutureTermsAssoc()))) {
         // Remove the term dropdown and repalce it
         $this->form->dropElement('term');
         $this->form->addSelect('term', array($this->intern->term => Term::rawToRead($this->intern->term)));
         $this->form->setLabel('term', 'Select Term');
         $this->form->addCssClass('term', 'form-control');
     }
     $this->form->setMatch('term', $this->intern->term);
     $this->form->setMatch('experience_type', $this->intern->getExperienceType());
     // Plug
     $this->form->plugIn($this->formVals);
     /**
      * *
      * Emergency Contacts
      */
     //javascript('jquery');
     PHPWS_Core::initModClass('intern', 'EmergencyContactFactory.php');
     $contacts = EmergencyContactFactory::getContactsForInternship($this->intern);
     $emgContactJson = json_encode($contacts);
     Layout::add(javascriptMod('intern', 'emergencyContact', array('existing_contacts_json' => $emgContactJson)));
 }
開發者ID:sinkdb,項目名稱:InternshipInventory,代碼行數:35,代碼來源:EditInternshipFormView.php

示例2: buildInternshipForm


//.........這裏部分代碼省略.........
     /**********************
      * Internship details *
      */
     /***********************
      * Internship location *
      */
     $loc = array('domestic' => 'Domestic', 'internat' => 'International');
     $this->form->addRadioAssoc('location', $loc);
     //$this->form->setMatch('location', 'domestic'); // Default to domestic
     //$this->form->setRequired('location');
     // Domestic fields
     $this->form->addText('loc_address');
     $this->form->setLabel('loc_address', 'Address');
     $this->form->addCssClass('loc_address', 'form-control');
     $this->form->addText('loc_city');
     $this->form->setLabel('loc_city', 'City');
     $this->form->addCssClass('loc_city', 'form-control');
     $this->form->addSelect('loc_state', State::getAllowedStates());
     $this->form->setLabel('loc_state', 'State');
     $this->form->addCssClass('loc_state', 'form-control');
     $this->form->addText('loc_zip');
     $this->form->setLabel('loc_zip', 'Zip');
     $this->form->addCssClass('loc_zip', 'form-control');
     // Itn'l location fields
     $this->form->addText('loc_province');
     $this->form->setLabel('loc_province', 'Province/Territory');
     $this->form->addCssClass('loc_province', 'form-control');
     $this->form->addText('loc_country');
     $this->form->setLabel('loc_country', 'Country');
     $this->form->addCssClass('loc_country', 'form-control');
     /*************
      * Term Info *
      */
     $terms = Term::getFutureTermsAssoc();
     $terms[-1] = 'Select Term';
     $this->form->addSelect('term', $terms);
     $this->form->setLabel('term', 'Select Term');
     $this->form->addCssClass('term', 'form-control');
     $this->form->addText('start_date');
     $this->form->setLabel('start_date', 'Start Date');
     $this->form->addCssClass('start_date', 'form-control');
     $this->form->addText('end_date');
     $this->form->setLabel('end_date', 'End Date');
     $this->form->addCssClass('end_date', 'form-control');
     $this->form->addText('credits');
     $this->form->setLabel('credits', 'Credit Hours');
     $this->form->addCssClass('credits', 'form-control');
     $this->form->addText('avg_hours_week');
     $this->form->setLabel('avg_hours_week', 'Average Hours per Week');
     $this->form->addCssClass('avg_hours_week', 'form-control');
     $this->form->addCheck('multipart');
     $this->form->setLabel('multipart', 'This internship is part of a multi-part experience.');
     $this->form->addCheck('secondary_part');
     $this->form->setLabel('secondary_part', 'This is a secondary part (enrollment complete through primary part).');
     /***************
      * Course Info *
      */
     $subjects = Subject::getSubjects();
     $this->form->addSelect('course_subj', $subjects);
     $this->form->setLabel('course_subj', 'Subject');
     $this->form->addCssClass('course_subj', 'form-control');
     $this->form->addText('course_no');
     $this->form->setLabel('course_no', 'Number');
     $this->form->addCssClass('course_no', 'form-control');
     $this->form->addText('course_sect');
     $this->form->setLabel('course_sect', 'Section');
開發者ID:sinkdb,項目名稱:InternshipInventory,代碼行數:67,代碼來源:InternshipFormView.php


注:本文中的Term::getFutureTermsAssoc方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。