當前位置: 首頁>>代碼示例>>PHP>>正文


PHP render_view函數代碼示例

本文整理匯總了PHP中render_view函數的典型用法代碼示例。如果您正苦於以下問題:PHP render_view函數的具體用法?PHP render_view怎麽用?PHP render_view使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了render_view函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send_email

function send_email($to, $data, $template, $subject = 'No Subject', $reply_to = false, $attachments = false)
{
    global $email_from;
    $boundary = uniqid('veev');
    $boundar2 = uniqid('inner');
    $headers = 'From: ' . $email_from . ($reply_to == false ? '' : "\r\n" . 'Sender: ' . $email_from . "\r\n" . 'Reply-To: ' . $reply_to) . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: multipart/related; boundary=' . $boundary . "\r\n" . '--' . $boundary . "\r\n" . 'Content-Type: multipart/alternative; boundary=' . $boundar2 . "\r\n";
    //
    $message = render_view('email/' . $template . '.php', $data);
    //
    $message = "\r\n" . '--' . $boundar2 . "\r\n" . 'Content-type: text/plain; charset=utf-8' . "\r\n\r\n" . strip_tags($message) . "\r\n\r\n--" . $boundar2 . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n\r\n" . $message . "\r\n\r\n" . '--' . $boundar2 . '--' . "\r\n" . '--' . $boundary;
    if ($attachments !== false) {
        foreach ($attachments as $filename => $data) {
            if (!isset($data) && file_exists($filename)) {
                $data = base64_encode(file_get_contents($filename));
                $filename = substr($filename, strrpos($filename, '/') + 1);
            } else {
                if (strlen($data) < 128 && file_exists($data)) {
                    $data = base64_encode(file_get_contents($data));
                }
            }
            $message .= "\r\n" . 'Content-Type: application/octet-stream; name="' . $filename . '"' . "\r\n" . 'Content-Transfer-Encoding: base64' . "\r\n" . 'Content-Disposition: attachment' . "\r\n\r\n" . $data . "\r\n--" . $boundary;
        }
    }
    $message .= '--';
    $mail_sent = @mail($to, $subject, $message, $headers);
    return $mail_sent;
}
開發者ID:Villvay,項目名稱:veev,代碼行數:27,代碼來源:email.php

示例2: onBefore

 public function onBefore()
 {
     //render header
     if (!$this->isAjax()) {
         render_view("header");
     }
 }
開發者ID:abhilashlohar,項目名稱:Housingmatters,代碼行數:7,代碼來源:login.php

示例3: show_form

function show_form()
{
    $name = _req('name');
    $teacher = _req('teacher');
    $description = _req('description');
    $teachers = Teacher::search()->find(Searcher::KEY_VALUE_PAIR);
    render_view('master', compact('teachers', 'name', 'teacher', 'description'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:8,代碼來源:add_course.php

示例4: show_form

function show_form()
{
    $genders = $GLOBALS['config']['gender'];
    $name = _req('name');
    $gender = _req('gender');
    $description = _req('description');
    render_view('master', compact('genders', 'name', 'gender', 'description'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:8,代碼來源:add_teacher.php

示例5: comment_add_GET

/**
 * @author  ryan <cumt.xiaochi@gmail.com>
 */
function comment_add_GET($teacher, $comment)
{
    $has_login = $GLOBALS['has_login'];
    if (!$has_login) {
        return;
    }
    $teacher = new Teacher($teacher);
    $comment = new Comment($comment);
    render_view('master', compact('teacher', 'comment', 'has_login'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:13,代碼來源:comment_add.php

示例6: register_GET

/**
 * @author  ryan <cumt.xiaochi@gmail.com>
 */
function register_GET()
{
    if ($GLOBALS['has_login']) {
        redirect();
    }
    $config = $GLOBALS['config'];
    $genders = $config['gender'];
    $schools = $config['school'];
    render_view('master', compact('genders', 'schools'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:13,代碼來源:register.php

示例7: index

/**
 * @file    index
 * @author  ryan <cumt.xiaochi@gmail.com>
 * @created Jun 27, 2012 6:24:01 PM
 */
function index()
{
    $recentTeachers = Teacher::search()->orderBy('touched DESC')->find();
    $recentComments = Comment::search()->OrderBy('id DESC')->find();
    $data = compact('recentTeachers', 'recentCourses', 'recentComments');
    if ($GLOBALS['has_login']) {
        $timelines = Timeline::search()->filterBy('user', $GLOBALS['user'])->find();
        $data['timelines'] = $timelines;
    }
    render_view('master', $data);
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:16,代碼來源:index.php

示例8: login_end

function login_end()
{
    // if user is already logged in,
    // to index since we didn't provide such a link
    if ($GLOBALS['has_login']) {
        redirect();
        // to index
    }
    $username = _req('username');
    render_view('master', array('msg' => $GLOBALS['msg'], 'username' => $username));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:11,代碼來源:login.php

示例9: teacher_GET

/**
 * @author  ryan <cumt.xiaochi@gmail.com>
 */
function teacher_GET($id)
{
    $teacher = new Teacher($id);
    $comments = Comment::search()->filterBy('teacher', $id)->find();
    $has_login = $GLOBALS['has_login'];
    if ($has_login) {
        $teacher->commentedByMe = $teacher->commentedByUser($GLOBALS['user']);
    }
    $schools = $GLOBALS['config']['school'];
    render_view('master', compact('teacher', 'courses', 'comments', 'has_login', 'schools'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:14,代碼來源:teacher.php

示例10: send_email

function send_email($to, $data, $template, $subject = 'No Subject', $reply_to = false, $attachments = false)
{
    global $email_from, $admin_email;
    $boundary = uniqid('np');
    $headers = 'To: ' . $to . "\r\n" . 'From: ' . $email_from . ($reply_to == false ? '' : "\r\n" . 'Sender: ' . $email_from . "\r\n" . 'Reply-To: ' . $reply_to) . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: multipart/alternative; boundary=' . $boundary . "\r\n";
    //
    $message = render_view('email/' . $template . '.php', $data);
    //
    $message = strip_tags($message) . "\r\n\r\n--" . $boundary . "\r\n" . 'Content-type: text/html;charset=utf-8' . "\r\n\r\n" . $message . "\r\n\r\n--" . $boundary . '--';
    $mail_sent = @mail($to, $subject, $message, $headers);
    return $mail_sent;
}
開發者ID:vishva8kumara,項目名稱:tinyF-x2-,代碼行數:12,代碼來源:email.php

示例11: course_GET

/**
 * @author  ryan <cumt.xiaochi@gmail.com>
 */
function course_GET($id)
{
    $course = new Course($id);
    $teacher = $course->teacher();
    $comments = $course->comments();
    $has_login = $GLOBALS['has_login'];
    $data = compact('course', 'teacher', 'canStar', 'has_login', 'comments');
    if ($has_login) {
        $data['myStar'] = $course->starBy($GLOBALS['user']);
    }
    render_view('master', $data);
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:15,代碼來源:course.php

示例12: frontend_render_cell_content

 function frontend_render_cell_content($target)
 {
     global $ddl_fields_api;
     $ddl_fields_api->set_current_cell_content($this->get_content());
     if (function_exists('render_view')) {
         global $WPV_view_archive_loop, $wp_query;
         $WPV_view_archive_loop->query = clone $wp_query;
         $WPV_view_archive_loop->in_the_loop = true;
         $target->cell_content_callback(render_view(array('id' => get_ddl_field('ddl_layout_view_id'))), $this);
         $WPV_view_archive_loop->in_the_loop = false;
     } else {
         $target->cell_content_callback(WPDDL_Messages::views_missing_message(), $this);
     }
 }
開發者ID:javierdlahoz,項目名稱:paella-development,代碼行數:14,代碼來源:wpddl.cell_views_loop.class.php

示例13: comment

/**
 * @author  ryan <cumt.xiaochi@gmail.com>
 */
function comment($teacher, $comment)
{
    $teacher = new Teacher($teacher);
    $comment = new Comment($comment);
    $additions = $comment->additions();
    $discusses = $comment->discusses();
    $has_login = $GLOBALS['has_login'];
    if ($has_login) {
        $u = $GLOBALS['user'];
        $comment->likedByMe = $comment->attitudeByUser('like', $u);
        $comment->hatedByMe = $comment->attitudeByUser('hate', $u);
        $commentedByMe = $comment->user == $u->id;
    }
    render_view('master', compact('teacher', 'comment', 'has_login', 'discusses', 'commentedByMe', 'additions'));
}
開發者ID:TheDenisNovikov,項目名稱:teacher,代碼行數:18,代碼來源:comment.php

示例14: exceptionHandler

 /**
  * handle exception in runtime
  *
  * @param Exception $exception exception to handle
  */
 public function exceptionHandler($exception)
 {
     $message = $exception->getMessage();
     render_view("exception", array("message" => $message));
     render_view("footer");
     exit;
 }
開發者ID:buraka1,項目名稱:mlazarov-rockmongo,代碼行數:12,代碼來源:BaseController.php

示例15: render_view

/*
 * Making sure Wordless plugin is enabled
 */
if (!class_exists("Wordless")) {
    echo "This theme requires the <a href='https://github.com/welaika/wordless'>Wordless plugin</a> in order to work. Please, install it now!";
    die;
}
/*
 * In this page, you need to setup Wordless routing: you first
 * determine the type of the page using WordPress conditional tags,
 * and then delegate the rendering to some particular view using
 * the `render_view()` helper.
 *
 * To specify a layout other than the default one, please pass it as
 * the second parameter to the `render_view()` method.
 *
 * For a list of conditional tags, please see here: http://codex.wordpress.org/Conditional_Tags
 */
if (is_front_page()) {
    // Home Template
    render_view("pages/home");
} elseif (is_single()) {
    // Single Post on Blog Template
    render_view("posts/single");
} elseif (is_page()) {
    // Single Page Template
    render_view("pages/single");
} else {
    // Archive Template
    render_view("posts/archive");
}
開發者ID:nerdfiles,項目名稱:brooklynmeatballcompany_com,代碼行數:31,代碼來源:index.php


注:本文中的render_view函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。