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


PHP render函数代码示例

本文整理汇总了PHP中render函数的典型用法代码示例。如果您正苦于以下问题:PHP render函数的具体用法?PHP render怎么用?PHP render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了render函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: zone_agenda

 public function zone_agenda($id_c, $choix)
 {
     try {
         if ($id_c != 0) {
             $animal = requetemysql::findunanimal2(array('id_ani' => $id_c));
             if (empty($animal)) {
                 throw new Exception("Error in findunanimal2 function ! param : id_ani: " + $id_c);
             }
         } else {
             $animal = json_encode($id_c);
         }
         // liste des vétos du tour de garde
         $vetos = requetemysql::listevetos();
         if (empty($vetos)) {
             throw new Exception("Error in listevetos fonction !");
         }
         if ($choix == "week") {
             render('_agenda', array('title' => 'Agenda partagé du tour de garde', 'animal' => $animal, 'liste_vetos' => $vetos));
         } elseif ($choix == "day") {
             render('_agenda2', array('title' => 'Agenda du ' + date("d/m/y"), 'animal' => $animal, 'liste_vetos' => $vetos));
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
开发者ID:astrolabb,项目名称:aerogard3.2,代码行数:25,代码来源:agenda.controller.php

示例2: index_index

function index_index()
{
    $data = array();
    $data['template_file'] = 'admin/index.php';
    $data['title'] = 'Trang Admin';
    render('layout_admin.php', $data);
}
开发者ID:anhnt0212,项目名称:simple-php-mvc,代码行数:7,代码来源:index.php

示例3: bill_detail

function bill_detail()
{
    $data = array();
    $user = adminLogged();
    if (!adminLogged()) {
        redirect('/index.php?c=admin&m=login');
    } else {
        $bill_detail = model('bill')->getBillDetails($_GET['id']);
        $data['total'] = 0;
        foreach ($bill_detail as $key => $b) {
            $book = model('book')->getSingle($b['book_id']);
            $bill_detail[$key]['name'] = $book['name'];
            $bill_detail[$key]['price'] = intval($book['price']);
            $bill_detail[$key]['total'] = $book['price'] * $b['quantity'];
            $bill_detail[$key]['image'] = $book['image'];
            $data['total'] += $book['price'] * $b['quantity'];
        }
        $data['bill_detail'] = $bill_detail;
    }
    $data['statuses'] = array('Chờ duyệt', 'Đang giao hàng', 'Đã giao hàng', 'Hủy');
    $data['stt'] = model('bill')->getOneBy($_GET['id'], null)['status'];
    if (isPostRequest()) {
        $postData = postData();
        db_update('bills', $postData, 'id=' . $_GET['id']);
        $data['stt'] = $postData['status'];
        $data['error'] = 'Tình trạng đơn hàng update thành công.';
    }
    $data['user'] = model('user')->getOneBy(model('bill')->getOneBy($_GET['id'], null)['user_id'], null);
    $data['template_file'] = 'bill/detail.php';
    render('layout.php', $data);
}
开发者ID:huynhtrucquyen0812,项目名称:EntryBlog,代码行数:31,代码来源:bill.php

示例4: testWhosOnlineBlock

 /**
  * Test the Who's Online block.
  */
 function testWhosOnlineBlock()
 {
     $block = $this->drupalPlaceBlock('views_block:who_s_online-who_s_online_block');
     // Generate users.
     $user1 = $this->drupalCreateUser(array('access user profiles'));
     $user2 = $this->drupalCreateUser(array());
     $user3 = $this->drupalCreateUser(array());
     // Update access of two users to be within the active timespan.
     $this->updateAccess($user1->id());
     $this->updateAccess($user2->id(), REQUEST_TIME + 1);
     // Insert an inactive user who should not be seen in the block, and ensure
     // that the admin user used in setUp() does not appear.
     $inactive_time = REQUEST_TIME - 15 * 60 - 1;
     $this->updateAccess($user3->id(), $inactive_time);
     $this->updateAccess($this->adminUser->id(), $inactive_time);
     // Test block output.
     \Drupal::currentUser()->setAccount($user1);
     $content = entity_view($block, 'block');
     $this->drupalSetContent(render($content));
     $this->assertRaw(t('2 users'), 'Correct number of online users (2 users).');
     $this->assertText($user1->getUsername(), 'Active user 1 found in online list.');
     $this->assertText($user2->getUsername(), 'Active user 2 found in online list.');
     $this->assertNoText($user3->getUsername(), 'Inactive user not found in online list.');
     $this->assertTrue(strpos($this->drupalGetContent(), $user1->getUsername()) > strpos($this->drupalGetContent(), $user2->getUsername()), 'Online users are ordered correctly.');
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:28,代码来源:UserBlocksTest.php

示例5: home_index

function home_index()
{
    $data = array();
    $data['template_file'] = 'index/index.php';
    $data['title'] = 'Trang chủ';
    render('layout_home.php', $data);
}
开发者ID:anhnt0212,项目名称:simple-php-mvc,代码行数:7,代码来源:home.php

示例6: linkSimple

 public function linkSimple($label, $path, $image = null)
 {
     $url = \Meta\Builder::replaceURL(\Meta\Builder::replaceOutput($this->row, $path));
     $label = \Meta\Builder::replaceOutput($this->row, $label);
     $link = render('builder-link.php', array('url' => $url, 'label' => $label, 'img' => $image));
     return $link;
 }
开发者ID:moiseh,项目名称:metapages,代码行数:7,代码来源:Formatters.php

示例7: error_message

/**
 * Renders an error message.
 */
function error_message($message)
{
    render('header', ['title' => 'Error']);
    render('error_message', ['message' => $message]);
    render('footer');
    exit;
}
开发者ID:jupiterhyun,项目名称:project0,代码行数:10,代码来源:helpers.php

示例8: main

function main()
{
    // создаем сессию
    session_start();
    if (is_current_user()) {
        // если пользователь уже залогинен, то отправляем его на глапную
        redirect('./');
    }
    if (is_postback()) {
        // обрабатываем отправленную форму
        $dbh = db_connect();
        $post_result = register_user($dbh, $user, $errors);
        db_close($dbh);
        if ($post_result) {
            // перенаправляем на главную
            redirect('./');
        } else {
            // информация о пользователе заполнена неправильно, выведем страницу с ошибками
            render('register_form', array('form' => $_POST, 'errors' => $errors));
        }
    } else {
        // отправляем пользователю чистую форму для регистрации
        render('register_form', array('form' => array(), 'errors' => array()));
    }
}
开发者ID:jatvarthur,项目名称:php_samples,代码行数:25,代码来源:register.php

示例9: view_all

 public static function view_all()
 {
     global $db;
     $query = $db->query('SELECT * FROM scores ORDER BY userid,service');
     set('scores', $query->fetchAll(PDO::FETCH_OBJ));
     return render('home.php');
 }
开发者ID:nsystem1,项目名称:leaderboard,代码行数:7,代码来源:score.php

示例10: events_show

function events_show()
{
    global $event;
    $event = new Event();
    $event = $event->find($_GET['id']);
    render();
}
开发者ID:bjcpgd,项目名称:palserve,代码行数:7,代码来源:events.php

示例11: content_ajax_page_fc

 private function content_ajax_page_fc($fcid)
 {
     $fcitem = \Drupal\field_collection\Entity\FieldCollectionItem::load($fcid);
     $target = WG::entity_get_field_value($fcitem, 'field_target');
     preg_match('%^([^:]+)://([0-9]+)$%', $target, $m);
     $itemtype = $m[1];
     $id = $m[2];
     switch ($itemtype) {
         case 'public318':
             $identifier = $id;
             $text = WG::entity_get_field_formatted_text($fcitem, 'field_annotation');
             $stylename = 'large';
             $icon_uri = _expo_public318_get_icon_uri($identifier);
             $icontag = WG::render_styled_image($icon_uri, $stylename);
             $output = '<div class="sticky-fc-public318">' . '<div class="collicon">' . _expo_coll_url($identifier, $icontag) . '</div>' . '<div class="colltext">' . $text . '</div>' . '</div>';
             break;
         case 'storynode':
             $nid = $id;
             $story = node_load($nid);
             $v = entity_view($story, 'ajaxpage');
             $output = render($v);
             break;
         default:
             $tag = "<div class=\"sticky\" id=\"sticky_{$pos}\">" . $itemtype . $pos . "</div>";
     }
     $build = ['#markup' => $output];
     return $build;
 }
开发者ID:318io,项目名称:318-io,代码行数:28,代码来源:ExpoController.php

示例12: sms_coupon

function sms_coupon($coupon, $mobile = null)
{
    global $INI;
    if ($coupon['consume'] == 'Y' || $coupon['expire_time'] < strtotime(date('Y-m-d'))) {
        return $INI['system']['couponname'] . '已失效';
    }
    $user = Table::Fetch('user', $coupon['user_id']);
    $order = Table::Fetch('order', $coupon['order_id']);
    if (!Utility::IsMobile($mobile)) {
        $mobile = $order['mobile'];
        if (!Utility::IsMobile($mobile)) {
            $mobile = $user['mobile'];
        }
    }
    if (!Utility::IsMobile($mobile)) {
        return '请设置合法的手机号码,以便接受短信';
    }
    $team = Table::Fetch('team', $coupon['team_id']);
    $partner = Table::Fetch('partner', $coupon['partner_id']);
    $coupon['end'] = date('Y-n-j', $coupon['expire_time']);
    $coupon['name'] = $team['product'];
    $content = render('manage_tpl_smscoupon', array('partner' => $partner, 'coupon' => $coupon, 'user' => $user));
    if (true === ($code = sms_send($mobile, $content))) {
        Table::UpdateCache('coupon', $coupon['id'], array('sms' => array('`sms` + 1'), 'sms_time' => time()));
        return true;
    }
    return $code;
}
开发者ID:hhdem,项目名称:tuangala_v2,代码行数:28,代码来源:sms.php

示例13: index

function index()
{
    modTitle('Planit | Deconnexion');
    setAlert('Vous êtes bien déconnecté, redirection vers la page d\'accueil dans 5 secondes', 'danger');
    deco();
    render();
}
开发者ID:kasuke5,项目名称:planit,代码行数:7,代码来源:logout.php

示例14: gen_cmd_pages

function gen_cmd_pages($cmd, $parent = array())
{
    $parent[] = $cmd['name'];
    $binding = $cmd;
    $binding['synopsis'] = implode(' ', $parent);
    $binding['path'] = implode('/', $parent);
    $binding['has-subcommands'] = isset($cmd['subcommands']) ? array(true) : false;
    if ($cmd['longdesc']) {
        $docs = $cmd['longdesc'];
        $docs = htmlspecialchars($docs, ENT_COMPAT, 'UTF-8');
        // decrease header level
        $docs = preg_replace('/^## /m', '### ', $docs);
        // escape `--` so that it doesn't get converted into `&mdash;`
        $docs = preg_replace('/^(\\[?)--/m', '\\1\\--', $docs);
        $docs = preg_replace('/^\\s\\s--/m', '  \\1\\--', $docs);
        // hack to prevent double encoding in code blocks
        $docs = preg_replace('/ &lt; /', ' < ', $docs);
        $docs = preg_replace('/ &gt; /', ' > ', $docs);
        $docs = preg_replace('/ &lt;&lt;/', ' <<', $docs);
        $docs = preg_replace('/&quot;/', '"', $docs);
        $binding['docs'] = $docs;
    }
    $path = __DIR__ . "/commands/" . $binding['path'];
    if (!is_dir($path)) {
        mkdir($path);
    }
    file_put_contents("{$path}/index.md", render('subcmd-list.mustache', $binding));
    if (!isset($cmd['subcommands'])) {
        return;
    }
    foreach ($cmd['subcommands'] as $subcmd) {
        gen_cmd_pages($subcmd, $parent);
    }
}
开发者ID:fjarrett,项目名称:wp-cli.github.com,代码行数:34,代码来源:Phakefile.php

示例15: plugin_basic_auth

function plugin_basic_auth()
{
    $data['bauth_username'] = kget('bauth_username');
    $data['bauth_password'] = kget('bauth_password');
    $data['bauth_on'] = kget('bauth_on');
    return render($data, 'ajax', 'plugin', 'basic_auth');
}
开发者ID:ramo01,项目名称:1kapp,代码行数:7,代码来源:app.php


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