本文整理汇总了PHP中View::renderElement方法的典型用法代码示例。如果您正苦于以下问题:PHP View::renderElement方法的具体用法?PHP View::renderElement怎么用?PHP View::renderElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::renderElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render
public function _render($options)
{
if ($this->getParam('layout') === 'vCard') {
$this->_renderVCardLayout($options);
} else {
$columns = $this->postColumns;
$rowSpan = 12 / $columns;
$foundPosts = count($this->posts);
$rowClass = array('row-fluid');
if ($this->shouldPaginate) {
$rowClass[] = 'slides-container';
}
?>
<div class="<?php
echo implode(' ', $rowClass);
?>
">
<?php
$counter = 1;
while (have_posts()) {
the_post();
global $post;
View::renderElement('layout-components-parts/single/staff', array('rowSpan' => $rowSpan, 'columns' => $columns, 'counter' => $counter, 'shouldPaginate' => $this->shouldPaginate, 'post' => $post, 'excerptLength' => $this->getParam('excerptLength'), 'socialNetworksDisplay' => Set::booleanize($this->getParam('socialNetworksDisplay'))));
if ($counter % $columns === 0 && $counter < $foundPosts && $this->getParam('layout') === 'grid') {
echo '</div><div class="row-fluid">';
}
$counter++;
}
?>
</div>
<?php
}
}
示例2: _render
protected function _render($options)
{
$networks = Set::filter(Set::booleanize($this->getParam('socialNetworks')));
echo '<div class="bluebox-share-options">';
echo '<span>' . __('Share The Story', 'gummfw') . '</span>';
echo '<div class="bluebox-details-social">';
View::renderElement('social-links', array('networks' => $networks, 'accountMode' => 'share', 'additionalClass' => 'bluebox-shadows'));
echo '</div>';
echo '</div>';
}
示例3: _render
protected function _render($options)
{
global $post;
$mediaDimensions = array();
if ($this->getParam('mediaCrop') === 'crop') {
$rowSpan = 12 * $this->widthRatio();
$mediaDimensions = array('ar' => $this->getParam('aspectRatio'), 'context' => 'span' . $rowSpan);
}
if ($post->Thumbnail) {
if (count($post->Media) > 1) {
$sliderType = $this->getParam('sliderType');
$settings = array_merge($this->getDefaultSettingsForSlider($sliderType), array('elementId' => $this->id(), 'media' => $post->Media, 'dimensions' => $mediaDimensions, 'linkToParent' => false));
switch ($sliderType) {
case 'flex':
View::renderElement('layout-components-parts/sliders/flex-slider', $settings);
break;
case 'windy':
View::renderElement('layout-components-parts/sliders/windy-slider', $settings);
break;
case 'ios':
View::renderElement('layout-components-parts/sliders/ios-slider', $settings);
break;
}
} elseif ($post->PostMeta['featured_image_single_display']) {
?>
<?php
$imageDetailsAtts = array('class' => 'image-details', 'style' => 'display:inline;');
$prettyPhotoLink = '';
$thePostMediaGuid = '';
if ($post->Media) {
$thePostMediaGuid = $post->Media[0]->guid;
} else {
$thePostMediaGuid = $post->Thumbnail->guid;
}
if ($this->getParam('prettyPhotoSingleLink') === 'true') {
$imageDetailsAtts['style'] = '';
$prettyPhotoLink = '<a href="' . $thePostMediaGuid . '" class="image-details-link image-wrap-mask" rel="prettyPhoto[featured-image-for-' . $post->ID . ']"><i class="icon-search"></i></a>';
}
?>
<div class="image-wrap">
<span<?php
$this->Html->_constructTagAttributes($imageDetailsAtts);
?>
>
<?php
echo $this->Media->display($thePostMediaGuid, $mediaDimensions, array('alt' => get_the_title()));
echo $prettyPhotoLink;
?>
</span>
</div>
<?php
}
}
}
示例4: render
/**
* @return void
*/
public function render($fields)
{
$networks = Set::filter(Set::booleanize($this->getParam('socialNetworks')));
$mode = $this->getParam('mode');
// echo '<div class="bluebox-share-options">';
// echo '<span>' . __('Share The Story') . '</span>';
echo '<div class="bluebox-details-social">';
View::renderElement('social-links', array('networks' => $networks, 'accountMode' => $mode, 'additionalClass' => 'social-link bluebox-shadows'));
echo '</div>';
// echo '</div>';
}
示例5: render
/**
* @return void
*/
public function render($fields)
{
$elementId = uniqid();
echo '<div class="blog-1-col">';
while (have_posts()) {
the_post();
global $post;
View::renderElement('layout-components-parts/post/single-vertical-item', array('post' => $post, 'displayMetaInfo' => $fields['metaFieldsDisplay'] === 'true', 'elementId' => $elementId, 'lightBoxLinkDisplay' => $fields['lightBoxLinkDisplay'] === 'true'));
}
echo '</div>';
}
示例6: _render
protected function _render($options)
{
$rowSpan = 12 * $this->widthRatio();
$mediaDimensions = array('ar' => $this->getParam('aspectRatio'), 'context' => 'span' . $rowSpan);
$linkToParent = $this->getParam('mediaSource') === 'post';
$sliderType = $this->getParam('sliderType');
$settings = array_merge($this->getDefaultSettingsForSlider($sliderType), array('elementId' => $this->id(), 'media' => $this->media, 'dimensions' => $mediaDimensions, 'linkToParent' => $linkToParent));
switch ($sliderType) {
case 'flex':
View::renderElement('layout-components-parts/sliders/flex-slider', $settings);
break;
case 'windy':
View::renderElement('layout-components-parts/sliders/windy-slider', $settings);
break;
case 'ios':
View::renderElement('layout-components-parts/sliders/ios-slider', $settings);
break;
}
}
示例7: getlayoutMarkup
function getlayoutMarkup($layoutMarkup, $layoutTokens, $dataModuleResult, $Content, $matches, $topic)
{
$ModuleView = new View($this->Controller);
$ModuleView->layout = $this->layout;
if (sizeof($layoutTokens['specific']) > 0) {
$jsUpdateModuleVal = "";
for ($i = 0; $i < sizeof($layoutTokens['specific']); ++$i) {
$moduleName = $layoutTokens['specific'][$i]['moduleName'];
//Accessing Modules name
$moduleSize = $layoutTokens['specific'][$i]['size'];
//Accessing Modules size
$moduleContent = $Content["specific"][$i];
//Accessing Modules content
$moduleUpdateInSeconds = $dataModuleResult["specific"][$i]['Module']['updateInSeconds'];
//Accessing Modules Update in Seconds.
//If Module is youtube, We need to get the first video ID to display it on the player and get related videos.
//js string with every Modules name and their corresponding Update in seconds value to be used on js timer (refresher).
if ($moduleName != 'youtube') {
$jsUpdateModuleVal .= "CPB.modules.setUpdateInSeconds('{$moduleName}', '{$moduleUpdateInSeconds}');";
}
//Getting the Token name of every module
$moduleTokenName = $matches[0][$i];
//Accessing every module view and Delivering named as Module name vars in plural with their corresponing values (array).
//echo "<pre>"; print_r($moduleContent); echo "</pre>";
if (sizeof($moduleContent) > 0) {
$ModuleView->set("{$moduleName}s", $moduleContent);
//pass topic
App::import("Model", "Topic");
$Topic = new Topic();
$ModuleView->set('topic', $Topic->getTopicAbbr($topic));
//Saving every rendered Module
$moduleSize = $moduleSize == "mobile" ? "mobile" : "modules";
$showModule = $ModuleView->renderElement("../" . $moduleSize . "/" . $moduleName . "/" . $moduleName);
//Replacing every Module Token name with their corresponding Module Content
//Only condition for jobs module is needed....
//$showModule = $moduleName == "jobs"?"<div class='Section' id='Jobs'>{$showModule}</div>":"<div id='{$moduleName}_module'>{$showModule}</div>";
$layoutMarkup = str_replace($moduleTokenName, $showModule, $layoutMarkup);
} else {
$layoutMarkup = str_replace($moduleTokenName, "", $layoutMarkup);
}
}
$layoutMarkup = str_replace("*#*jsUpdateModuleString*#*", $jsUpdateModuleVal, $layoutMarkup);
}
return $layoutMarkup;
}
示例8: renderTitle
/**
* @return void
*/
protected function renderTitle()
{
if (!$this->supports('title')) {
return;
}
// if ($this->getParam('enableHeading') !== 'true') return;
$elementParams = array('elementId' => $this->id(), 'title' => $this->getParam('headingText'), 'paginate' => $this->shouldPaginate);
View::renderElement('layout-components-parts/heading', $elementParams);
}
示例9: _render
protected function _render($options)
{
View::renderElement('social-links', array('networks' => $this->getParam('networks')));
}
示例10: foreach
<div class="bluebox-head-bottom">
<?php
if ($headerLayout !== 'two') {
?>
<div class="bluebox-prime-nav bluebox-container">
<?php
$gummHtmlHelper->displayMenu(array('class' => 'prime-nav'));
?>
</div>
<?php
}
?>
</div>
<?php
View::renderElement('header/page-heading');
?>
</div>
</div>
<!-- END header -->
<?php
$headerElements = is_page() ? $GummTemplateBuilder->getTemplateElementsEnabled('header') : null;
if ($headerElements) {
foreach ($headerElements as $headerElement) {
echo '<div class="row-fluid">';
$headerElement->render();
echo '</div>';
}
}
?>
示例11: renderVerticalSingleLayout
public function renderVerticalSingleLayout()
{
echo '<div class="blog-1-col">';
while (have_posts()) {
the_post();
global $post;
View::renderElement('layout-components-parts/post/single-vertical-item', array('lightBoxLinkDisplay' => $this->getParam('lightBoxLinkDisplay') === 'true', 'elementId' => $this->id()));
}
echo '</div>';
}
示例12: getTabPostHtml
private function getTabPostHtml($tab, $options)
{
$postType = $tab['post_type']['post_type'];
$args = array('post_type' => $postType, 'posts_per_page' => $tab['post_type']['posts_number']);
if (isset($tab['post_type'][$postType . '-category'])) {
$this->setParam($postType . '-category', $tab['post_type'][$postType . '-category']);
}
$this->queryPosts($args, $tab['post_type']);
echo '<div class="blog-1-col">';
while (have_posts()) {
the_post();
global $post;
View::renderElement('layout-components-parts/post/single-vertical-item', array('elementId' => $this->id() . '_' . $post->post_type));
}
echo '</div>';
wp_reset_query();
}
示例13: mediaManager
/**
* @param array $option
* @param array $attributes
* @return string
*/
public function mediaManager(array $option, array $attributes, array $settings)
{
$settings = array_merge(array('buttons' => array('media', 'embed')), $settings);
$outputHtml = '';
$uploadedMedia = '';
$optionId = $this->model . '.' . $option['id'];
if (is_array($this->value)) {
foreach ($this->value as $attachmentId) {
if (is_numeric($attachmentId)) {
$attachmentPost = get_post($attachmentId);
if (!$attachmentPost) {
continue;
}
$uploadedMedia .= View::renderElement('media/admin_add', array('optionId' => $optionId, 'model' => $this->model, 'attachmentPost' => $attachmentPost), false);
}
}
}
$outputHtml .= $this->Media->mediaManager(array('name' => $option['id'], 'content' => $uploadedMedia, 'optionId' => $optionId, 'buttons' => $settings['buttons']));
$outputHtml .= '<input type="hidden" name="_mergeonsave" value="0" />';
return $outputHtml;
}
示例14:
}
?>
<!-- END footer content -->
</div>
</div>
</div>
<!-- END footer -->
</div>
<!-- END bluebox container -->
<?php
if (Configure::read('build') !== 'release') {
View::renderElement('front-end-preview-panel');
}
?>
<?php
echo $gummWpHelper->getOption('google_analytics');
?>
<?php
wp_footer();
?>
</body>
</html>
示例15: _renderEventsListall
public function _renderEventsListall($events)
{
$args = array('post_type' => 'event', 'numberposts' => '-1', 'meta_key' => GUMM_THEME_PREFIX . '_event_start_time', 'orderby' => GUMM_THEME_PREFIX . '_event_start_time', 'order' => 'ASC', 'meta_query' => array(array('key' => GUMM_THEME_PREFIX . '_event_start_time', 'value' => date_i18n('Y/m/d H:i'), 'compare' => '>=')));
if ($eventCatIds = $this->getEventCategories()) {
$args['tax_query'] = array(array('taxonomy' => 'event_category', 'field' => 'term_id', 'terms' => (array) $eventCatIds));
}
query_posts($args);
while (have_posts()) {
the_post();
global $post;
$divAtts = array('class' => array('bluebox-events-list'));
if (!$post->Thumbnail) {
$divAtts['class'][] = 'no-image';
}
?>
<div<?php
echo $this->Html->_constructTagAttributes($divAtts);
?>
>
<div class="event-date-line">
<div class="date-details-wrap">
<?php
$eventStartDate = $this->Wp->getPostMeta($post->ID, 'event_start_time');
if (isset($_GET['rd'])) {
$date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($_GET['rd']));
} elseif ($eventStartDate) {
$eventStartDate = preg_replace("'[a-z]'i", '', $eventStartDate);
$date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($eventStartDate));
} else {
$date = date_i18n('\\<\\s\\t\\r\\o\\n\\g\\>j\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\p\\a\\n\\>M\\<\\/\\s\\p\\a\\n\\>', strtotime($post->post_date));
}
echo $date;
?>
</div>
</div>
<div class="event-details">
<div class="event-content-wrap">
<div class="image-wrap">
<div class="image-details">
<?php
if ($post->Thumbnail) {
echo '<a href="' . get_permalink() . '" class="image-details">';
echo $this->Media->display($post->Thumbnail->guid, array('ar' => 1, 'context' => 'span4'), array('alt' => get_the_title()));
echo '</a>';
}
?>
</div>
</div>
<div class="event-content">
<div class="page-heading-wrap">
<h2><?php
the_title();
?>
</h2>
<?php
if ($post->GummOption['display_rating'] !== 'false') {
View::renderElement('layout-components-parts/event/rating', array('rating' => (int) $post->PostMeta['event_rating']));
}
?>
</div>
<div class="event-inner-content-wrap">
<?php
the_excerpt();
?>
<a href="<?php
echo $this->getPermalink($post);
?>
" class="event-more-link icon-plus"></a>
</div>
</div>
</div>
</div>
</div>
<?php
}
wp_reset_query();
}