• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Content类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: indexAction

 public function indexAction()
 {
     $content = new Content();
     $slug = $this->_getParam('slug');
     if ($slug == '\\d+') {
         $content = new Content();
         $this->view->contents = $content->getFrontContent('treports');
         $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
         $client = Zend_Gdata_ClientLogin::getHttpClient($this->_config->webservice->google->username, $this->_config->webservice->google->password, $service);
         $docs = new Zend_Gdata_Docs($client);
         $docsQuery = new Zend_Gdata_Docs_Query();
         $docsQuery->setQuery('title:Treasure Annual Report');
         $feed = $docs->getDocumentListFeed($docsQuery);
         $documents = array();
         foreach ($feed->entries as $entry) {
             $title = $entry->title;
             foreach ($entry->link as $link) {
                 if ($link->getRel() === 'alternate') {
                     $altlink = $link->getHref();
                 }
             }
             $documents[] = array('title' => $title, 'altlink' => $altlink, 'updated' => $entry->updated, 'type' => $entry->content->type, 'published' => $entry->published);
         }
         $this->view->documents = $documents;
     } else {
         $this->view->contents = $content->getContent('treports', $this->_getParam('slug'));
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:28,代码来源:ReportsController.php


示例2: find

 /**
  * Tries to find content that matches the input query
  * @param string $query
  */
 public function find($query)
 {
     $q = implode('%', explode(' ', $query));
     $sql = 'SELECT content.* FROM content JOIN idiom ON content.idiom_id = idiom.id
         WHERE idiom.code = ? AND content.publish = 1 
             AND (
                 content.keywords like (?)
                 OR content.alias like (?) 
                 OR content.title like (?)
                 OR content.description like (?)
                 OR content.intro like (?)
                 OR content.html like (?)
                 )
         ORDER BY visits DESC';
     // Prepare values and run query
     $q = "%{$q}%";
     $rows = R::getAll($sql, array(BootWiki::getIdiom(), $q, $q, $q, $q, $q, $q));
     $results = R::convertToBeans('content', $rows);
     if (!empty($results)) {
         foreach ($results as $item) {
             $content = new Content($item->alias);
             $content->importBean($item);
             $this->items[] = $content;
         }
     }
 }
开发者ID:taviroquai,项目名称:bootwiki,代码行数:30,代码来源:Results.php


示例3: executeNovaPagina

 public function executeNovaPagina(sfWebRequest $request)
 {
     if ($request->isXmlHttpRequest() || true) {
         //apenas por ajax
         sfConfig::set('sf_web_debug', false);
         sfProjectConfiguration::getActive()->loadHelpers(array('I18N', 'Date'));
         $cmspage = new Cmspage();
         $content = new Content();
         $content->setId(null);
         $cmspage->setContent($content);
         $cmspage->setId(null);
         $cmsGroupcontent = $this->getUser()->getAttribute('contentGroup');
         $this->forward404Unless($cmsGroupcontent);
         $cmspage->setCmsgroupcontent($cmsGroupcontent);
         $this->formContent = new PageContentForm($cmspage);
         if ($request->isMethod('post')) {
             //return $this->renderPartial('cms/debug',array('values'=>$request->getParameter('pagina')));
             $this->formContent->bind($request->getParameter('pagina'));
             if ($this->formContent->isValid()) {
                 $this->logMessage('O formContent foi válido. cms/actions: ' . __FILE__ . __LINE__);
                 try {
                     $this->formContent->save();
                     return $this->renderPartial("cms/viewPage", array('page' => $this->formContent->getCmspageobj(), 'isNew' => true, 'values' => $this->formContent->getValues()));
                 } catch (Exception $e) {
                     //TODO: We should to handle the error and render it.
                     throw $e;
                 }
                 //return $this->renderPartial("cms/viewPage",array('page'));
             }
         }
         //parent::executeNew($request);
         return $this->renderPartial('cms/content_form', array('formContent' => $this->formContent));
     }
 }
开发者ID:rafaelccomp,项目名称:compsite,代码行数:34,代码来源:actions.class.php


示例4: indexAction

 /** Setup index page
  */
 public function indexAction()
 {
     $content = new Content();
     $this->view->contents = $content->getFrontContent('database');
     $thumbs = new Slides();
     $this->view->thumbs = $thumbs->getLast10Thumbnails(4);
     $finds = new Finds();
     $this->view->counts = $finds->getCountAllFinds();
     $recent = new Logins();
     $this->view->logins = $recent->todayVisitors();
     $form = new SolrForm();
     $form->setMethod('post');
     $this->view->form = $form;
     $values = $form->getValues();
     if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
         if ($form->isValid($form->getValues())) {
             $params = array_filter($form->getValues());
             $params = $this->array_cleanup($params);
             $this->_flashMessenger->addMessage('Your search is complete');
             $this->_helper->Redirector->gotoSimple('results', 'search', 'database', $params);
         } else {
             $form->populate($data);
         }
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:27,代码来源:IndexController.php


示例5: indexAction

 /** Initialise the index pages
  * @access public
  * @return void
  */
 public function indexAction()
 {
     $content = new Content();
     $this->view->contents = $content->getFrontContent('research');
     $research = new ResearchProjects();
     $this->view->research = $research->getCounts();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:11,代码来源:IndexController.php


示例6: replaceSection

 /**
  * @see Content::replaceSection()
  */
 public function replaceSection($section, Content $with, $sectionTitle = '')
 {
     wfProfileIn(__METHOD__);
     $myModelId = $this->getModel();
     $sectionModelId = $with->getModel();
     if ($sectionModelId != $myModelId) {
         wfProfileOut(__METHOD__);
         throw new MWException("Incompatible content model for section: " . "document uses {$myModelId} but " . "section uses {$sectionModelId}.");
     }
     $oldtext = $this->getNativeData();
     $text = $with->getNativeData();
     if ($section === '') {
         wfProfileOut(__METHOD__);
         return $with;
         # XXX: copy first?
     }
     if ($section == 'new') {
         # Inserting a new section
         $subject = $sectionTitle ? wfMessage('newsectionheaderdefaultlevel')->rawParams($sectionTitle)->inContentLanguage()->text() . "\n\n" : '';
         if (wfRunHooks('PlaceNewSection', array($this, $oldtext, $subject, &$text))) {
             $text = strlen(trim($oldtext)) > 0 ? "{$oldtext}\n\n{$subject}{$text}" : "{$subject}{$text}";
         }
     } else {
         # Replacing an existing section; roll out the big guns
         global $wgParser;
         $text = $wgParser->replaceSection($oldtext, $section, $text);
     }
     $newContent = new WikitextContent($text);
     wfProfileOut(__METHOD__);
     return $newContent;
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:34,代码来源:WikitextContent.php


示例7: filterMergedContent

 /**
  * Hook function for EditFilterMergedContent
  *
  * @param IContextSource $context
  * @param Content        $content
  * @param Status         $status
  * @param string         $summary
  * @param User           $user
  * @param bool           $minoredit
  *
  * @return bool
  */
 static function filterMergedContent(IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
 {
     $title = $context->getTitle();
     if (isset($title->spamBlackListFiltered) && $title->spamBlackListFiltered) {
         // already filtered
         return true;
     }
     // get the link from the not-yet-saved page content.
     // no need to generate html to get external links
     $pout = $content->getParserOutput($title, null, null, false);
     $links = array_keys($pout->getExternalLinks());
     // HACK: treat the edit summary as a link
     if ($summary !== '') {
         $links[] = $summary;
     }
     $spamObj = BaseBlacklist::getInstance('spam');
     $matches = $spamObj->filter($links, $title);
     if ($matches !== false) {
         $status->fatal('spamprotectiontext');
         foreach ($matches as $match) {
             $status->fatal('spamprotectionmatch', $match);
         }
     }
     // Always return true, EditPage will look at $status->isOk().
     return true;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:38,代码来源:SpamBlacklistHooks.php


示例8: serializeContent

 /**
  * Serializes the CollaborationHubContent object.
  *
  * @param $content Content
  * @param $format string|null
  * @return mixed
  */
 public function serializeContent(Content $content, $format = null)
 {
     if ($format === self::FORMAT_WIKI) {
         return $content->convertToHumanEditable();
     }
     return parent::serializeContent($content, $format);
 }
开发者ID:wikimedia,项目名称:mediawiki-extensions-CollaborationKit,代码行数:14,代码来源:CollaborationHubContentHandler.php


示例9: addTitlle

 function addTitlle($Category, $Id, $Lang)
 {
     require_once 'classes/model/Content.php';
     $content = new Content();
     $value = $content->load($Category, '', $Id, $Lang);
     return $value;
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:7,代码来源:processes_Export.php


示例10: executeAttribute

 public function executeAttribute(Content &$objContent)
 {
     $objContent->setAttribute('teste', 'HAHA!!!');
     $objContent->setFlush('teste', '12334343430');
     //$this->forward('Default','Index');
     $this->redirectIndoor('Default', 'Index');
     return ViewActions::VIEW_NONE;
 }
开发者ID:suga,项目名称:Megiddo,代码行数:8,代码来源:ActionDefault.php


示例11: OrderedList

 public function OrderedList($content, $attr = null)
 {
     $Items = new Content();
     foreach ($content as $item) {
         $Items->AddContent($this->ListItem($item));
     }
     return new Tag('ol', $Items, $attr);
 }
开发者ID:Drake86cnf,项目名称:yacare,代码行数:8,代码来源:Bootstrap3Generator.php


示例12: doIt

 /**
  * @access public
  * @param aExtrinsicState
  * @ParamType aExtrinsicState 
  */
 public function doIt($tagRoute, $parameters)
 {
     $menuEntity = $GLOBALS['sys_menu'];
     $menuTemplate = new Content($menuEntity, $menuEntity);
     $menuTemplate->setFilter("sys_menu_parent_id", $parameters["parent_id"]);
     $menuTemplate->setOrderFields("sys_menu_position", 'sys_menu_parent', "sys_menu0_position");
     return $menuTemplate->get();
 }
开发者ID:patriziopezzilli,项目名称:Fusion,代码行数:13,代码来源:front.php


示例13: pageAction

 /** Setup an individual page
  * @access public
  * @return void
  */
 public function pageAction()
 {
     if ($this->getParam('slug', 0)) {
         $this->view->contents = $this->_content->getContent('medievalcoins', (string) $this->getParam('slug'));
     } else {
         throw new Pas_Exception_Param($this->_missingParameter, 500);
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:12,代码来源:ArticlesController.php


示例14: factory

 public static function factory($id = null)
 {
     $instance = new Content();
     if (!empty($id)) {
         $instance->where('id', $id)->get();
     }
     return $instance;
 }
开发者ID:jotavejv,项目名称:CMS,代码行数:8,代码来源:content.php


示例15: indexAction

 /** The default action - show the home page
  */
 public function indexAction()
 {
     if ($this->_getParam('slug', 0)) {
         $content = new Content();
         $this->view->content = $content->getContent('frg', $this->_getParam('slug'));
     } else {
         throw new Pas_ParamException($this->_missingParameter);
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:11,代码来源:TorecordingController.php


示例16: indexAction

 /** Set up each page
  * @access public
  * @return void
  * @throws Pas_Exception_Param
  */
 public function indexAction()
 {
     if ($this->getParam('slug', false)) {
         $content = new Content();
         $this->view->contents = $content->getContent('conservation', $this->getParam('slug'));
     } else {
         throw new Pas_Exception_Param('That page is not found.', 404);
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:14,代码来源:AdviceController.php


示例17: show

 public function show()
 {
     $_SESSION["apps"] = $_GET["id"];
     include_once "views/content.php";
     $content = new Content();
     $result = $content->show();
     $this->vars["result"] = $result;
     ContentView::render($this->vars, "showContent");
 }
开发者ID:asancheza,项目名称:box,代码行数:9,代码来源:ContentController.php


示例18: executeCulture

 public function executeCulture(Content &$objContent)
 {
     $objCulture = new Culture();
     $culture = $objCulture->checkCulture($this->getRequestParameter('isolang'));
     $objContent->getObjCulture()->setCulture($culture);
     $module = $this->getRequestParameter('module');
     $action = $this->getRequestParameter('action');
     $this->redirectIndoor($module, $action);
 }
开发者ID:suga,项目名称:Megiddo,代码行数:9,代码来源:ActionGeneral.php


示例19: setAnalysisEmail

 public function setAnalysisEmail(Analyse $analysis, $emailTo, $toName)
 {
     $content = new Content();
     $message = $content->getAnalysisContent($analysis, Session::getLoggedUser()->getFirstName());
     $email = new Email();
     $email->setSubject("Olá " . $toName . "! Você recebeu uma análise do Bureau Inteligencia!");
     $email->setMessage($message);
     return $email->send(null, $emailTo);
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:9,代码来源:EmailController.php


示例20: toModel

 private function toModel($dto)
 {
     // Convert DTO into model object
     $content = new Content();
     $content->setName($dto['name']['S']);
     $content->setType($dto['type']['S']);
     $content->setEmailOwner($dto['owner']['S']);
     $content->setUrl($dto['url']['S']);
     return $content;
 }
开发者ID:Cherry-project,项目名称:website,代码行数:10,代码来源:ContentDAO.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ContentController类代码示例发布时间:2022-05-23
下一篇:
PHP Container类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap