本文整理汇总了PHP中Renderer::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Renderer::output方法的具体用法?PHP Renderer::output怎么用?PHP Renderer::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer::output方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/**
* List Topic Pages
*/
namespace MySociety\TheyWorkForYou;
// Disable the old PAGE class.
$new_style_template = TRUE;
// Include all the things this page needs.
include_once '../../includes/easyparliament/init.php';
// Array of topic page names (must exist in metadata.php) and titles to display.
$data['topics'] = array('topicbenefits' => 'Benefits', 'topiccrimestats' => 'Crime Statistics', 'topicnhs' => 'NHS');
// Send for rendering!
Renderer::output('topic/list', $data);
示例2: elseif
}
} elseif ($THEUSER->postcode_is_set()) {
$member = new Member(array('postcode' => $THEUSER->postcode(), 'house' => HOUSE_TYPE_COMMONS));
} else {
$data['display_postcode_form'] = true;
}
}
// If a member exists then we can go and do policies
if (isset($member)) {
$data['member_name'] = $member->full_name();
$data['member_id'] = $member->member_id();
$data['member_url'] = $member->url();
$data['member_image'] = $member->image();
$data['member_constituency'] = $member->constituency();
// Build the policy set
$policies = new Policies();
$policies = $policies->limitToSet($data['policyset']);
// Grab extra member info
// TODO: Shouldn't this be loaded on request?
$member->load_extra_info();
// Get their position on relevant policies!
$policyPositions = new PolicyPositions($policies, $member);
$data['positions'] = $policyPositions->positions;
$data['sinceString'] = $policyPositions->sinceString;
}
// Send for rendering!
Renderer::output('topic/topic', $data);
} else {
header('HTTP/1.0 404 Not Found');
Renderer::output('topic/error', array('error' => 'Sorry, but there isn’t a topic page by that name.'));
}