当前位置: 首页>>代码示例>>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;未经允许,请勿转载。