本文整理汇总了PHP中views_embed_view函数的典型用法代码示例。如果您正苦于以下问题:PHP views_embed_view函数的具体用法?PHP views_embed_view怎么用?PHP views_embed_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了views_embed_view函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: viewElements
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
$view_name = $item->getValue()['target_id'];
$display_id = $item->getValue()['display_id'];
$argument = $item->getValue()['argument'];
if ($argument != '') {
$view = views_embed_view($view_name, $display_id, $argument);
}
else {
$view = views_embed_view($view_name, $display_id);
}
if ($this->getSetting('render_view')) {
$elements[$delta] = array(
'#markup' => render($view),
// todo what cache shall we use?
'#cache' => array(
// 'tags' => $user->getCacheTags(),
),
);
}
}
return $elements;
}
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:33,代码来源:ViewsReferenceFieldFormatter.php
示例2: er_browser_widget_search_content
function er_browser_widget_search_content(array &$form, FormStateInterface $form_state)
{
$form = \Drupal::formBuilder()->getForm('Drupal\\er_browser_widget\\Form\\EntityReferenceBrowserWidgetForm');
$response = new AjaxResponse();
$title = $this->t('Entity Search and Reference.');
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';
$response->setAttachments($form['#attached']);
$content = views_embed_view('entity_reference_browser_widget');
$options = array('dialogClass' => 'test-dialog', 'width' => '75%');
$modal = new OpenModalDialogCommand($title, $form, $options);
$response->addCommand($modal);
return $response;
}
开发者ID:karthikvaluebound,项目名称:er_browser_widget,代码行数:13,代码来源:EntityReferenceBrowserWidget.php
示例3: phptemplate_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars)
{
// print_r($vars);
$vars['primary_links'] = _opensourcery_primary_links($vars['primary_links']);
$vars['secondary_links'] = _opensourcery_secondary_links($vars['secondary_links']);
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
// Render the slideshow view for homepage
$vars['embedded_slideshow'] = views_embed_view('homeslideshow', 'block_1');
//Reload the javascript into the scripts due to a problem with slideshow.
$vars['scripts'] = drupal_get_js();
}
开发者ID:itorres,项目名称:drupal-theme_guifinet2011,代码行数:18,代码来源:template.php
示例4: mailer
/**
* Mailer.
*/
public function mailer(Request $request)
{
$content = $request->getContent();
if (empty($content)) {
return new JsonResponse(['status' => 'error']);
}
$params = Json::decode($content);
$email = $params['email'];
$result = $params['selection'];
$progress = $params['progress'];
// Handle errors.
if (!valid_email_address($email) || strlen($result) < 2) {
return new JsonResponse(['status' => 'error']);
}
// Prepare email.
$to = [$email];
$view = views_embed_view('answer', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$nodes = Json::decode($content);
// Get the hidden fields
$view = views_embed_view('hideanswers', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$hidden = Json::decode($content);
$hidden = array_map(function ($item) {
return $item['nid'];
}, $hidden);
$view = views_embed_view('disclaimer', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$disclaimer = Json::decode($content);
$view = views_embed_view('intro_email', 'rest_export_1', $result);
$content = \Drupal::service('renderer')->render($view);
$intro = Json::decode($content);
$result = \Drupal::service('plugin.manager.mail')->mail('angapp', 'results', implode(', ', $to), \Drupal::currentUser()->getPreferredLangcode(), ['progress' => $progress, 'intro' => $intro, 'disclaimer' => $disclaimer, 'nodes' => $nodes, 'hidden' => $hidden]);
if ($result['result'] === TRUE) {
return new JsonResponse(['status' => 'ok']);
} else {
return new JsonResponse(['status' => 'error']);
}
}
开发者ID:UniversityofHelsinki,项目名称:Arrival-App,代码行数:42,代码来源:AppContainerController.php
示例5: run
function run()
{
// get html from view by setting_name
$setting = $_REQUEST['name'];
// get settings from civicrm
$settings = CRM_Core_BAO_Setting::getItem('windowsill', 'settings');
$decode = json_decode(utf8_decode($settings), true);
// variables
$error = TRUE;
$content = "";
$view = array();
// loop settings
foreach ($decode as &$value) {
// get view data if setting exists
if ($setting == $value['name']) {
$error = FALSE;
$view = explode(':', $value['view']);
break;
}
}
// check if setting exists & set page variables
if (!$error) {
$title = $setting;
$content .= views_embed_view($view[0], $view[1]) . "<br>";
} else {
$title = "Configuration error";
$content .= "Check your windowsill settings.";
}
// assign page title
CRM_Utils_System::setTitle(ts('WindowSill Render'));
// assign a variable for use in a template
$this->assign('title', $title);
$this->assign('content', $content);
// render
parent::run();
}
开发者ID:kewljuice,项目名称:be.ctrl.windowsill,代码行数:36,代码来源:render.php
示例6: views_embed_view
<?php
echo views_embed_view('top_news_first', 'default', $output) . views_embed_view('news_tabs_right_side', 'default', $output);
开发者ID:MKM-ITAO,项目名称:riigiteenused_kood,代码行数:3,代码来源:views-view-field--top-news-tabs--block--tid.tpl.php
示例7: arg
<?php
//$block = module_invoke('views', 'block_view', 'destinos-block_1');
//print render($block['content']);
//Block Productos (Destinos)
$tid = arg(2);
$term = taxonomy_term_load($tid);
$my_arg = $term->name;
$block = views_embed_view('destinos', 'block_1', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Viajes por ') . $my_arg . '</h3>';
if (!empty($block)) {
print $block;
} else {
print t('No se encontraron viajes en ') . $my_arg;
}
//Block Restaurantes (Destinos)
$block_restaurantes = views_embed_view('restaurantes', 'block', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Restaurantes por ') . $my_arg . '</h3>';
if (!empty($block_restaurantes)) {
print $block_restaurantes;
} else {
print t('No se encontraron restaurantes en ') . $my_arg;
}
//Block Hoteles (Destinos)
$block_hoteles = views_embed_view('hotels', 'block', $my_arg);
print '<h3 class="lined" style="margin-top: 12px">' . t('Hoteles por ') . $my_arg . '</h3>';
if (!empty($block_hoteles)) {
print $block_hoteles;
} else {
print t('No se encontraron restaurantes en ') . $my_arg;
}
开发者ID:defrox,项目名称:bikespain,代码行数:31,代码来源:taxonomy-term--destinosss.tpl.php
示例8: views_embed_view
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/business-news">Business News</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'business_news');
?>
</div>
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/whats-new">What's New</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'whats_new');
?>
</div>
<div class="panel panel-carousel slide">
<div class="panel-heading">
<h3 class="panel-title"><a href="/quick-facts">Quick Facts</a></h3>
</div>
<?php
print views_embed_view('front_page_news_views', 'quick_facts');
?>
</div>
</div>
</div>
</div>
</div>
开发者ID:hosttor,项目名称:BusinessUSA-OpenSource,代码行数:31,代码来源:frontpage-newsblock.tpl.php
示例9: views_embed_view
?>
' class="email" target="_blank" title="Email this content"><img src="/sites/all/themes/mortgage_new_theme/images/mail1.png" /></a>
</span>
<span class="chicklets copy-to-clipboard">
<textarea class="js-copytextarea" id="copytext_<?php
print $nid;
?>
"><?php
print $url1;
?>
</textarea>
<a href="javascript:void(0)" class="copy-link js-textareacopybtn" title="Copy link to clipboard" onclick="customCopyText('copytext_<?php
print $nid;
?>
');">Copy Textarea</a>
</span>
</div>
<!-- Flag link-->
<?php
print $flag_link;
?>
</span>
</div>
<div class="views-popup-container"><?php
print views_embed_view('popup_views', 'block_1', $nid);
?>
</div>
</div>
<?php
}
开发者ID:snehal-addweb,项目名称:Mortgagespeak,代码行数:31,代码来源:views-view-unformatted--company-view-detail--page.tpl.php
示例10: hide
?>
</div>
<?php endif;?>
<div id="js-contentFilterContainer"></div>
<?php
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
?>
<?php print render($content); ?>
<div class="linkedContent view-recent-activity">
<?php print views_embed_view('relations_to_nodes', 'parents'); ?>
<?php print views_embed_view('relations_to_nodes', 'evidence'); ?>
<?php print views_embed_view('relations_to_nodes', 'relationteaser'); ?>
</div>
<?php if (user_is_logged_in()): ?>
<div class="linkingForm"><?php print render($select_relation) ?></div>
<?php endif; ?>
<?php if ((user_is_logged_in() == FALSE) && ($open_to_comments == TRUE)): ?>
<div id='comment-form-container'><figure class='loginToCommentCTA'>
<h2 class='title comment-form'><?php print $comment_login_title ?></h2>
<span class='form-item'>
<label><?php print $comment_login_subject ?> </label><input class='form-control form-text' type='text' size='60'>
</span>
<span>
<span class='form-item'>
<label><?php print $comment_login_comment ?>
<span class='form-required'>*</span>
开发者ID:ec-europa,项目名称:futurium-features,代码行数:31,代码来源:node.tpl.php
示例11: page
/**
* Page callback: sample Views-based report.
*
* @see zeitgeist_preprocess_views_view()
*
* @return string
* HTML
*/
public function page()
{
$ret = views_embed_view('zeitgeist');
return $ret;
}
开发者ID:agroknow,项目名称:agreri,代码行数:13,代码来源:ReportViews.php
示例12: views_embed_view
$right_data = $large;
$left_data = views_embed_view('articles_view', 'vertical');
}
}
?>
<div class="major-blog_right">
<div class="<?php
print $r_css;
?>
blog_margin">
<?php
print $right_data;
?>
</div>
<div class="<?php
print $l_css;
?>
">
<?php
print $left_data;
?>
</div>
<div style="display: inline-block;">
<?php
print views_embed_view('articles_view', 'small');
?>
</div>
</div>
开发者ID:rahulmeghlan,项目名称:blogHTML,代码行数:31,代码来源:views-view-unformatted--articles-view--large.tpl.php
示例13: views_embed_view
?>
<div class="schools-wrapper">
<?php
print views_embed_view('instructors', 'instructors_schools_block', substr($relatedNodes['instructor'], 0, -1));
?>
</div>
<?php
}
?>
<?php
if ($relatedNodes['news']) {
?>
<div class="news-wrapper">
<?php
print views_embed_view('news', 'news_block', substr($relatedNodes['news'], 0, -1));
?>
</div>
<?php
}
?>
<?php
print render($content['links']);
?>
<?php
print render($content['comments']);
?>
</article>
开发者ID:home-work,项目名称:strip-federation,代码行数:31,代码来源:node--school.tpl.php
示例14: render
Tlf. 43 57 75 75</p>
<p><a href="mailto:[email protected]" title="Skriv e-mail til Ishøj Kommune">[email protected]</a></p>
</div>
<div class="grid-third sociale-medier">
<?php
print render($page['footer_sociale']);
?>
<h3>Følg os på sociale medier</h3>
<p>
<a class="sprite sprite-facebook footer" href="http://www.facebook.com/ishojkommune" title="Følg Ishøj Kommune på Facebook"><span><span class="screen-reader">Følg Ishøj Kommune på Facebook</span></span></a>
<a class="sprite sprite-linkedin footer" href="https://www.linkedin.com/company/ishoj-kommune" title="Følg Ishøj Kommune på LinkedIn"><span><span class="screen-reader">Følg Ishøj Kommune på LinkedIn</span></span></a>
<a class="sprite sprite-twitter footer" href="http://www.twitter.com/ishojkommune" title="Følg Ishøj Kommune på Twitter"><span><span class="screen-reader">Følg Ishøj Kommune på Twitter</span></span></a>
<a class="sprite sprite-youtube footer" href="http://www.youtube.com/tvishoj" title="Følg Ishøj Kommune på Youtube"><span><span class="screen-reader">Følg Ishøj Kommune på Youtube</span></span></a>
</p>
</div>
</div>
</div>
</footer>
<!-- FOOTER SLUT-->
<?php
// BREAKING
print views_embed_view('kriseinformation', 'pagevisning');
?>
</div>
<!-- PAGE SLUT -->
开发者ID:ishoj,项目名称:ishoj.dk,代码行数:30,代码来源:page--front.tpl.php
示例15: views_embed_view
<?php
// $Id: node.tpl.php,v 1.4 2007/08/07 08:39:36 goba Exp $
?>
<div id="event-title">
<h1><?php
print $node->title;
?>
</h1>
</div>
<div id="event-share">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4ddd07af51706810"></script>
<!-- AddThis Button END -->
</div>
<div id="category-wrapper"><?php
print views_embed_view('mainstage', 'page_1', $node->field_category_name[0]['value']);
?>
</div>
开发者ID:TakenCdosG,项目名称:queenstheatre_old_backup,代码行数:24,代码来源:node-event_category.tpl.php
示例16: render
><?php
print $title;
?>
</h1>
<?php
}
?>
<?php
print render($title_suffix);
?>
</header>
<?php
// Hide tags and links now so that we can render them later.
hide($content['links']);
print views_embed_view('organograms', 'block');
?>
<a class="organogram-full-screen" href="<?php
print $content['field_endpoint'][0]['#markup'];
?>
"><span><i class="icon-expand-alt"></i></span>Fullscreen</a>
<iframe width='100%' height='700px' src="<?php
print $content['field_endpoint'][0]['#markup'];
?>
" title="Content from external site: Application-orientated dynamic content, describing structure of government in organogram format"></iframe>
</article> <!-- /.node -->
<?php
if (!empty($content['links'])) {
?>
开发者ID:davidread,项目名称:dgu_d7,代码行数:31,代码来源:node--organogram.tpl.php
示例17: views_embed_view
<?php
$viewName = 'Media';
print views_embed_view($viewName);
开发者ID:radicaldesigns,项目名称:ahw,代码行数:3,代码来源:node-media.tpl.php
示例18: views_embed_view
<?php
/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
global $user;
if (!empty($title)) {
?>
<h3><?php
print $title;
?>
</h3>
<?php
}
?>
<div class="buy-main-container"><?php
print views_embed_view('countrywise_commodities', 'block_4');
?>
</div>
<div class="sell-main-container"><?php
print views_embed_view('countrywise_commodities', 'block_5');
?>
</div>
开发者ID:snehal-addweb,项目名称:eTrade,代码行数:26,代码来源:views-view-unformatted--countrywise-commodities--page.tpl.php
示例19: views_embed_view
<div class="clearfix aboutPanel">
<div class="clearfix">
<?php
print views_embed_view('home_panels', 'about_me');
?>
<!-- It's so much easier to work with a standalone view for the menu-->
</div>
</div>
开发者ID:shawnbeta,项目名称:portland-theme,代码行数:10,代码来源:about.php
示例20: testViewsEmbedView
/**
* Tests views.module: views_embed_view().
*/
public function testViewsEmbedView()
{
$this->enableModules(array('user'));
$result = views_embed_view('test_argument');
$this->assertEqual(count($result['#view']->result), 5);
$result = views_embed_view('test_argument', 'default', 1);
$this->assertEqual(count($result['#view']->result), 1);
$result = views_embed_view('test_argument', 'default', '1,2');
$this->assertEqual(count($result['#view']->result), 2);
$result = views_embed_view('test_argument', 'default', '1,2', 'John');
$this->assertEqual(count($result['#view']->result), 1);
$result = views_embed_view('test_argument', 'default', '1,2', 'John,George');
$this->assertEqual(count($result['#view']->result), 2);
}
开发者ID:ddrozdik,项目名称:dmaps,代码行数:17,代码来源:ModuleTest.php
注:本文中的views_embed_view函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论