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


PHP Tag::get方法代碼示例

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


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

示例1: Tag

 function test_should_store_zero_strings_as_intergers()
 {
     $Tag = new Tag(array('name' => 'Ticket #21'));
     $this->assertTrue($Tag->save());
     $this->assertEqual($Tag->get('score'), 100);
     $Tag->setAttributes(array('score' => '0'));
     $this->assertTrue($Tag->save());
     $Tag =& $Tag->find($Tag->id);
     $this->assertIdentical($Tag->get('score'), 0);
 }
開發者ID:joeymetal,項目名稱:v1,代碼行數:10,代碼來源:_AkActiveRecord_type_casting.php

示例2: allPagesToCache

 public function allPagesToCache()
 {
     // Get each page type to define its sub-urls
     $urls = array();
     // memory intensive depending on number of pages
     $pages = SiteTree::get()->where("ClassName != 'BlogEntry'");
     //remove Blog pages from cache due to Form SecurityID issue
     foreach ($pages as $page) {
         array_push($urls, $page->Link());
         if ($page->ClassName == 'ProjectPage') {
             //add ajax pages for each projectpage
             array_push($urls, $page->Link() . 'ajax');
         }
     }
     //add tag pages
     $tags = Tag::get()->filter(array('HasTagPage' => 1));
     foreach ($tags as $tag) {
         array_push($urls, '/tag/' . $tag->Slug);
     }
     //add location pages
     $locations = Location::get();
     foreach ($locations as $location) {
         array_push($urls, '/location/' . $location->Slug);
     }
     return $urls;
 }
開發者ID:nttan,項目名稱:silverstripe-portfolio,代碼行數:26,代碼來源:BasicPage.php

示例3: getCMSFields

 public function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'))->text('Title')->text('Code', 'Code', '', 5)->textarea('Description')->numeric('SessionCount', 'Number of sessions')->numeric('AlternateCount', 'Number of alternates')->checkbox('VotingVisible', "This category is visible to voters")->checkbox('ChairVisible', "This category is visible to track chairs")->hidden('SummitID', 'SummitID');
     if ($this->ID > 0) {
         //tags
         $config = new GridFieldConfig_RelationEditor(100);
         $config->removeComponentsByType(new GridFieldDataColumns());
         $config->removeComponentsByType(new GridFieldDetailForm());
         $completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
         $completer->setResultsFormat('$Tag');
         $completer->setSearchFields(array('Tag'));
         $completer->setSearchList(Tag::get());
         $editconf = new GridFieldDetailForm();
         $editconf->setFields(FieldList::create(TextField::create('Tag', 'Tag'), DropdownField::create('ManyMany[Group]', 'Group', array('topics' => 'Topics', 'speaker' => 'Speaker', 'openstack projects mentioned' => 'OpenStack Projects Mentioned'))));
         $summaryfieldsconf = new GridFieldDataColumns();
         $summaryfieldsconf->setDisplayFields(array('Tag' => 'Tag', 'Group' => 'Group'));
         $config->addComponent($editconf);
         $config->addComponent($summaryfieldsconf, new GridFieldFilterHeader());
         $tags = new GridField('AllowedTags', 'Tags', $this->AllowedTags(), $config);
         $fields->addFieldToTab('Root.Main', $tags);
         // extra questions for call-for-presentations
         $config = new GridFieldConfig_RelationEditor();
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('TrackTextBoxQuestionTemplate' => 'TextBox', 'TrackCheckBoxQuestionTemplate' => 'CheckBox', 'TrackCheckBoxListQuestionTemplate' => 'CheckBoxList', 'TrackRadioButtonListQuestionTemplate' => 'RadioButtonList', 'TrackDropDownQuestionTemplate' => 'ComboBox', 'TrackLiteralContentQuestionTemplate' => 'Literal'));
         $config->addComponent($multi_class_selector);
         $questions = new GridField('ExtraQuestions', 'Track Specific Questions', $this->ExtraQuestions(), $config);
         $fields->addFieldToTab('Root.Main', $questions);
     }
     return $fields;
 }
開發者ID:hogepodge,項目名稱:openstack-org,代碼行數:31,代碼來源:PresentationCategory.php

示例4: __str__

 protected function __str__()
 {
     if ($this->none()) {
         return "";
     }
     $result = new Tag("content");
     foreach ($this->access_members() as $name => $value) {
         if (!empty($value)) {
             switch ($name) {
                 case "type":
                 case "mode":
                     $result->param($name, $value);
                     break;
                 case "lang":
                 case "base":
                     $result->param("xml:" . $name, $value);
                     break;
                 case "value":
                     $result->value($value);
                     break;
             }
         }
     }
     return $result->get();
 }
開發者ID:hisaboh,項目名稱:w2t,代碼行數:25,代碼來源:AtomContent.php

示例5: test_get_tag

 public function test_get_tag()
 {
     $this->tag->insert();
     $t = Tag::get($this->text);
     $this->assertEquals($t->tag_text, $this->tag->tag_text);
     $t->delete();
 }
開發者ID:psaintlaurent,項目名稱:Habari,代碼行數:7,代碼來源:tagTest.php

示例6: post_diary

 public function post_diary($title, $summary)
 {
     $tag = new Tag("entry");
     $tag->param("xmlns", "http://www.w3.org/2007/app");
     $tag->add(new Tag("title", $title));
     $tag->add(new Tag("summary", $summary));
     $this->raw($tag->get("utf-8"));
     $this->do_post("http://mixi.jp/atom/diary/member_id=" . $this->member_id);
 }
開發者ID:hisaboh,項目名稱:w2t,代碼行數:9,代碼來源:Mixi.php

示例7: getPresentationFields

 protected function getPresentationFields()
 {
     $categorySource = Summit::get_active()->Categories()->map('ID', 'FormattedTitleAndDescription')->toArray();
     $categorySource['other'] = '<h4 class="category-label">Other topic...</h4>';
     $fields = FieldList::create()->text('Title', 'Proposed Presentation Title')->configure()->setAttribute('autofocus', 'TRUE')->end()->dropdown('Level', 'Please select the level of your presentation content')->configure()->setEmptyString('-- Select one --')->setSource(Presentation::create()->dbObject('Level')->enumValues())->end()->tinyMCEEditor('Description', 'Abstract')->configure()->setRows(20)->end()->literal('ShortDescriptionHelp', '<hr/><p>YouTube and other services limit the length of your presentation\'s description. Please provide a shorter, YouTube-friendly summary below.</p>')->literal('ShortDescriptionWordCount', '<p id="word-count"></p>')->tinyMCEEditor('ShortDescription', 'Short Description (450 Word Max)')->configure()->setRows(7)->setWordCount(450)->end()->literal('HR', '<hr/>')->optionset('CategoryID', 'What is the general topic of the presentation?')->configure()->setSource($categorySource)->end()->text('OtherTopic', 'Other topic (if one above does not match)')->configure()->displayIf('CategoryID')->isEqualTo('other')->end()->end()->literal('TagHelp', '<p>You can optionally add tags help attendees find presentations that interest them. Examples: <i>nova, ubuntu, ldap.</i></p>')->bootstrapTag('Tags', 'Presentation Tags (Optional)')->configure()->setLabelField('Tag')->setSource(Tag::get())->setPrefetch(Tag::get()->leftJoin('Presentation_Tags', 'TagID = Tag.ID')->sort('COUNT(Tag.ID)', 'DESC')->limit(10)->alterDataQuery(function ($query) {
         $query->groupby('Tag.ID');
     }))->setFreeInput(true)->end();
     return $fields;
 }
開發者ID:rbowen,項目名稱:openstack-org,代碼行數:9,代碼來源:PresentationForm.php

示例8: getCMSFields

 public function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'));
     if ($this->SchedID) {
         return $fields->tab('SchedData')->readonly('Title')->readonly('Description')->readonly('EventStart')->readonly('EventEnd')->readonly('EventKey')->readonly('EventType')->readonly('Goers')->readonly('SchedID')->readonly('InviteOnly')->readonly('Seats')->readonly('Venue')->readonly('VenueID')->tab('EditableData')->checkbox('DisplayOnSite')->text('YouTubeID')->dropdown('CategoryID', 'Category', PresentationCategory::get()->map('ID', 'Title'))->listbox('PresentationSpeakers')->configure()->setSource(PresentationSpeaker::get()->map('ID', 'Title')->toArray())->setMultiple(true)->end()->imageUpload('VideoThumbnail')->upload('RelatedMedia')->tag('Tags', 'Tags', Tag::get(), $this->Tags());
     } else {
         return $fields->text('Title')->dropdown('CategoryID', 'Category', PresentationCategory::get()->map('ID', 'Title'))->tag('Tags', 'Tags', Tag::get(), $this->Tags())->date('EventStart')->configure()->setConfig('showcalendar', true)->end()->date('EventEnd')->configure()->setConfig('showcalendar', true)->end()->htmlEditor('Description')->checkbox('InviteOnly')->numeric('Seats')->text('Venue')->text('YouTubeID')->imageUpload('VideoThumbnail')->upload('RelatedMedia')->checkbox('DisplayOnSite');
     }
 }
開發者ID:balajijegan,項目名稱:openstack-org,代碼行數:9,代碼來源:SchedPresentation.php

示例9: registerTags

 /**
  * @param string[] $tags
  * @return void
  */
 public function registerTags($tags)
 {
     $tags = explode(',', $tags);
     foreach ($tags as $tag_name) {
         $tag = Tag::get("Tag", "Tag = '" . $tag_name . "'")->first();
         if (!$tag) {
             $tag = new Tag();
             $tag->Tag = $tag_name;
             $tag->write();
         }
         $this->addTag($tag);
     }
 }
開發者ID:Thingee,項目名稱:openstack-org,代碼行數:17,代碼來源:News.php

示例10: __str__

 protected function __str__()
 {
     $result = new Tag("source");
     foreach ($this->access_members() as $name => $value) {
         if (!empty($value)) {
             switch ($name) {
                 case "url":
                 case "value":
                     $result->param($name, $value);
                     break;
             }
         }
     }
     return $result->get();
 }
開發者ID:hisaboh,項目名稱:w2t,代碼行數:15,代碼來源:RssSource.php

示例11: new_recipe

	public function new_recipe() {
    // Get data
    $tag = new Tag();
    $data['page_title'] = "- Create a Recipe";
    $data['tags'] = $tag->get()->all;

    // Header
    $this->load->view("header", $data);

    // Body of page
    $this->load->view('recipes/new_recipe');

    // Footer
    $this->load->view('footer');
  }
開發者ID:rubygeek,項目名稱:rubygeek,代碼行數:15,代碼來源:recipes.php

示例12: saveInto

 public function saveInto(DataObjectInterface $record)
 {
     if ($this->name) {
         $tags = explode(',', $this->dataValue());
         if (!$record instanceof SummitEvent) {
             return;
         }
         $record->Tags()->removeAll();
         foreach ($tags as $t) {
             $tag = Tag::get()->filter('Tag', $t)->first();
             if (is_null($tag)) {
                 $tag = Tag::create(array('Tag' => $t));
                 $tag->write();
             }
             $record->Tags()->add($tag);
         }
     }
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:18,代碼來源:TagManagerField.php

示例13: __str__

 protected function __str__()
 {
     if ($this->none()) {
         return "";
     }
     $result = new Tag("link");
     foreach ($this->access_members() as $name => $value) {
         if (!empty($value)) {
             switch ($name) {
                 case "href":
                 case "rel":
                 case "type":
                     $result->param($name, $value);
                     break;
             }
         }
     }
     return $result->get();
 }
開發者ID:hisaboh,項目名稱:w2t,代碼行數:19,代碼來源:AtomLink.php

示例14: __str__

 protected function __str__()
 {
     if ($this->none()) {
         return "";
     }
     $result = new Tag("author");
     foreach ($this->access_members() as $name => $value) {
         if (!empty($value)) {
             switch ($name) {
                 case "name":
                 case "url":
                 case "email":
                     $result->add(new Tag($name, $value));
                     $bool = true;
                     break;
             }
         }
     }
     return $result->get();
 }
開發者ID:hisaboh,項目名稱:w2t,代碼行數:20,代碼來源:AtomAuthor.php

示例15: sourceRecords

 /**
  * Setup the list of records to show.
  * @param type $params array of filter-rules.
  * @param type $sort
  * @param type $limit
  * @return \ArrayList with the records.
  */
 public function sourceRecords($params, $sort, $limit)
 {
     if ($sort) {
         $parts = explode(' ', $sort);
         $field = $parts[0];
         $direction = $parts[1];
     }
     $where = null;
     if (isset($params['Title']) && $params['Title'] != '') {
         $where = 'Title LIKE \'%' . $params['Title'] . '%\'';
     }
     $ret = Tag::get()->where($where);
     $returnSet = new ArrayList();
     if ($ret) {
         foreach ($ret as $record) {
             $record->Itemcount = $record->News()->count();
             $returnSet->push($record);
         }
     }
     return $returnSet;
 }
開發者ID:MilesSummers,項目名稱:silverstripe-newsmodule,代碼行數:28,代碼來源:TagReport.php


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