本文整理汇总了PHP中Parser::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::render方法的具体用法?PHP Parser::render怎么用?PHP Parser::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
function generate($source)
{
global $savefile;
$p = new Parser();
$p->parse('types.hh');
$p->parse($source);
ob_start();
$p->render('implementation.cc');
$contents = ob_get_contents();
ob_clean();
if (!$savefile) {
echo $contents;
} else {
file_put_contents('generated/' . str_replace('.i', '.cpp', $source), $contents);
}
}
示例2: should_render_mention
/** @test */
public function should_render_mention()
{
$text = $this->service->render('You should follow @philipbrown!');
$this->assertEquals('<p>You should follow <a href="https://cribbb.com/philipbrown">@philipbrown</a>!</p>', rtrim($text));
}
示例3: getCategoryPost
function getCategoryPost()
{
$id = 3;
// ID заданной рубрики
$count = 8;
if (isset($_POST['page'])) {
$paged = $_POST['page'];
} else {
$paged = 1;
}
$posts = get_posts(array('numberposts' => $count, 'offset' => $count * $paged, 'category' => $id));
$parser = new Parser();
$parser->render(TM_DIR . '/view/post.php', ['posts' => $posts]);
die;
}
示例4: about_product
function about_product()
{
$id = $_POST['id'];
$product = get_post($id);
$parser = new Parser();
$parser->render(TM_DIR . "/view/about.php", array('product' => $product), true);
die;
}
示例5: photoShortcode
function photoShortcode()
{
if ($_POST) {
$paged = $_POST['paged'];
} else {
$paged = 0;
}
$args = array('paged' => $paged, 'post_type' => 'photos', 'post_status' => 'publish', 'posts_per_page' => 6);
$my_query = null;
$my_query = new WP_Query($args);
$parser = new Parser();
if ($_POST) {
echo $parser->render(TM_DIR . '/view/photo.php', ['my_query' => $my_query]);
die;
} else {
$parser->render(TM_DIR . '/view/photo.php', ['my_query' => $my_query]);
}
}
示例6: productionShortcode
function productionShortcode()
{
$catId = get_category_by_slug('production');
$catId = $catId->term_id;
$posts = get_posts(['numberposts' => -1, 'category' => $catId, 'order' => 'DESC']);
$parser = new Parser();
$parser->render(TM_DIR . '/view/production.php', ['posts' => $posts]);
}
示例7: reviewShortcode
function reviewShortcode()
{
$args = array('post_type' => 'reviews', 'post_status' => 'publish', 'posts_per_page' => -1);
$my_query = null;
$my_query = new WP_Query($args);
$parser = new Parser();
$parser->render(TM_DIR . '/view/reviews.php', ['my_query' => $my_query]);
}
示例8: getFeed
function getFeed($atts)
{
global $wpdb;
$args = shortcode_atts(array('user_id' => '', 'offset' => 0, 'current_time' => 0), $atts);
if ($_POST) {
$user_id = $_POST['user_id'];
$offset = $_POST['offset'];
$current_time = $_POST['time'];
$events = $wpdb->get_results("SELECT * FROM `feed` WHERE `user_id` = '{$user_id}' ORDER BY `id` DESC LIMIT {$offset}, 10", ARRAY_A);
$parser = new Parser();
$parser->render(TM_DIR . '/view/account/feed.php', ['events' => $events, 'current_time' => $current_time]);
die;
} else {
$events = $wpdb->get_results("SELECT * FROM `feed` WHERE `user_id` = '{$args['user_id']}' ORDER BY `id` DESC LIMIT {$args['offset']}, 10", ARRAY_A);
$parser = new Parser();
$parser->render(TM_DIR . '/view/account/feed.php', ['events' => $events, 'current_time' => $args['current_time']]);
}
}
示例9: img_galeri
function img_galeri($id)
{
$parser = new Parser();
global $wpdb;
$result['img'] = $wpdb->get_results("SELECT * FROM wp_ngg_pictures WHERE galleryid=" . $id['id']);
$result['link'] = $wpdb->get_results("SELECT path FROM wp_ngg_gallery WHERE gid=" . $id['id']);
$p = $parser->render(TM_DIR . '/views/galery/galery.php', array('result' => $result), false);
return $p;
}
示例10: c7_form_fn
function c7_form_fn()
{
$parser = new Parser();
return $parser->render(TM_DIR . '/views/c7-form-views.php', array(), false);
}
示例11: index_channel_sc
function index_channel_sc()
{
$channels = getDataFromDb('channels');
$parser = new Parser();
$parser->render(ADD_BARON_DIR . "/view/indexchannels.php", array('channels' => $channels), true);
}
示例12: admin_subscriptions_page
function admin_subscriptions_page()
{
global $wpdb;
if (isset($_GET['del'])) {
$wpdb->delete('subscriptions', ['id' => $_GET['del']]);
}
$subscriptions = $wpdb->get_results("SELECT * FROM `subscriptions`", ARRAY_A);
$parser = new Parser();
$parser->render(TM_DIR . '/views/subscriptions_admin_page.php', ['subscriptions' => $subscriptions]);
}
示例13: admin_orders_page
function admin_orders_page()
{
global $wpdb;
$parser = new Parser();
if (isset($_GET['del'])) {
$wpdb->delete('tea', ['id' => $_GET['del']]);
}
$orders = $wpdb->get_results("SELECT * FROM tea", ARRAY_A);
$parser->render(TM_DIR . '/views/orders_admin_page.php', ['orders' => $orders]);
}
示例14: adminBookPage
function adminBookPage()
{
global $wpdb;
$parser = new Parser();
if (isset($_GET['del'])) {
$wpdb->delete('book', ['id' => $_GET['del']]);
}
if (isset($_POST['date'])) {
$wpdb->insert('book', ['dt' => $_POST['date']]);
}
$dates = $wpdb->get_results("SELECT * FROM `book`", ARRAY_A);
$parser->render(TM_DIR . '/view/admin/book.php', ['dates' => $dates]);
}
示例15: companylink_sc
function companylink_sc()
{
$links = getDataFromDb('companylinks');
$parser = new Parser();
$parser->render(TM_DIR . "/view/linksgrid.php", array('links' => $links), true);
}