当前位置: 首页>>代码示例>>PHP>>正文


PHP Parser::render方法代码示例

本文整理汇总了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);
    }
}
开发者ID:graphnode,项目名称:lov8,代码行数:16,代码来源:binder.php

示例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));
 }
开发者ID:kfuchs,项目名称:cribbb,代码行数:6,代码来源:CommonMarkParserTest.php

示例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;
}
开发者ID:king199025,项目名称:Fox-Kids,代码行数:15,代码来源:functions.php

示例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;
}
开发者ID:Kirbaba,项目名称:Media-Land,代码行数:8,代码来源:functions.php

示例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]);
    }
}
开发者ID:AKD47,项目名称:kvadroSafari,代码行数:18,代码来源:functions.php

示例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]);
}
开发者ID:Kirbaba,项目名称:JRA_Traiding,代码行数:8,代码来源:functions.php

示例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]);
}
开发者ID:Kirbaba,项目名称:RSChip-2.0,代码行数:8,代码来源:functions.php

示例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']]);
    }
}
开发者ID:Kirbaba,项目名称:RusMusic,代码行数:18,代码来源:functions.php

示例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;
}
开发者ID:Kirbaba,项目名称:shuttle,代码行数:9,代码来源:functions.php

示例10: c7_form_fn

function c7_form_fn()
{
    $parser = new Parser();
    return $parser->render(TM_DIR . '/views/c7-form-views.php', array(), false);
}
开发者ID:Bacsik,项目名称:school,代码行数:5,代码来源:functions.php

示例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);
}
开发者ID:Kirbaba,项目名称:Baron-Almaty,代码行数:6,代码来源:functions.php

示例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]);
}
开发者ID:Kirbaba,项目名称:ArtemBuk,代码行数:10,代码来源:functions.php

示例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]);
}
开发者ID:Kirbaba,项目名称:Irina-Nelson-Store,代码行数:10,代码来源:functions.php

示例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]);
}
开发者ID:AKD47,项目名称:ferst_task,代码行数:13,代码来源:functions.php

示例15: companylink_sc

function companylink_sc()
{
    $links = getDataFromDb('companylinks');
    $parser = new Parser();
    $parser->render(TM_DIR . "/view/linksgrid.php", array('links' => $links), true);
}
开发者ID:Kirbaba,项目名称:GoldenMedia,代码行数:6,代码来源:functions.php


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