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


PHP Routes::set方法代码示例

本文整理汇总了PHP中Routes::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Routes::set方法的具体用法?PHP Routes::set怎么用?PHP Routes::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Routes的用法示例。


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

示例1: fromId

<?php

// Set the needed routes
Routes::set('notifications/get', 'notifications#get');
Routes::set('notifications/clear', 'notifications#clear');
Routes::set('notifications/push', 'notifications#get_push_ticket');
/**
 * Class for sending notifications to users.
 */
class Notification
{
    /**
     * 180 days
     */
    const NOTIFICATION_EXPIRE = 15552000;
    /**
     * The maximum amount of notifications to show.
     */
    const NOTIFICAITON_MAX = 30;
    /**
     * The local database row.
     */
    private $row = null;
    /**
     * Gets a notification given its unique id.
     * @param int $notificationid The notification id.
     * @return \Notification
     */
    public static function fromId($notificationid)
    {
        $query = Database::connection()->prepare('SELECT * FROM user_notification WHERE notificationid = ?');
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:31,代码来源:notification.php

示例2: fromId

<?php

Routes::set('entry/get', 'entry#get');
Routes::set('entry/create', 'entry#create');
Routes::set('entry/delete', 'entry#delete');
Routes::set('entry/edit', 'entry#edit');
Routes::set('entry/upload_attachment', 'entry#upload_attachment');
Routes::set('entry/delete_attachment', 'entry#delete_attachment');
Routes::set('entry/attachment/{entryid}/{attachmentid}', 'entry#get_attachment', false);
/**
 * Represents a course entry.
 */
class Entry
{
    /**
     * The local database row.
     */
    private $row;
    /**
     * Local attachment storage.
     * @var Attachment[] 
     */
    private $attachments;
    /**
     * Gets a entry given its unique id.
     * @param int $entryid The entry id.
     * @return Entry
     */
    public static function fromId($entryid)
    {
        // See if theres a cache hit
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:31,代码来源:entry.php

示例3:

<?php

Routes::set('user/create', 'user#create');
Routes::set('user/fetch', 'user#fetch');
Routes::set('user/login', 'user#login');
Routes::set('user/logout', 'user#logout');
Routes::set('user/changepassword', 'user#change_password');
Routes::set('user/verify/{userid}/{code}', 'user#verify', false);
Routes::set('user/verify/resend', 'user#verify_resend');
Routes::set('user/recover', 'user#recover');
Routes::set('user/settings/setavatar', 'user#set_avatar');
Routes::set('user/avatar/{userid}/{attachmentid}.png', 'user#get_avatar', false);
/**
 * Class for handling and manipulating users.
 */
class User
{
    /**
     * The amount of time a temp password is valid for.
     */
    const TEMP_PASSWORD_EXPIRE_TIME = 10800;
    /**
     * The currently loaded row for the user.
     * @var array 
     */
    private $row = null;
    /**
     * Gets a user from their userid.
     * @param string $id The user's id.
     * @return User
     */
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:31,代码来源:user.php

示例4:

<?php

Routes::set('question/get', 'question#get');
Routes::set('question/create', 'question#create');
Routes::set('question/delete', 'question#delete');
Routes::set('question/edit', 'question#edit');
Routes::set('question/toggle_closed', 'question#toggle_closed');
Routes::set('question/toggle_private', 'question#toggle_private');
Routes::set('answer/get', 'question#get_answer');
Routes::set('answer/create', 'question#create_answer');
Routes::set('answer/delete', 'question#delete_answer');
Routes::set('answer/edit', 'question#edit_answer');
Routes::set('answer/toggle_like', 'question#toggle_like');
/**
 * Represnets a question that can be asked.
 */
class Question
{
    /**
     * The local database row.
     */
    private $row;
    /**
     * The cache of answers.
     * @var QuestionAnswer[]
     */
    private $answerCache;
    /**
     * Gets a question given its unique id.
     * @param int $questionid The question id.
     * @return Question
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:31,代码来源:question.php

示例5:

<?php

Routes::set('course/get_list', 'course#get_list');
Routes::set('course/get', 'course#get');
Routes::set('course/edit', 'course#edit');
Routes::set('course/add_students', 'course#add_students');
Routes::set('course/add_professor', 'course#add_professor');
Routes::set('course/remove_student', 'course#remove_student');
Routes::set('course/create', 'course#create');
/**
 * Represents a school course.
 */
class Course
{
    /**
     * The local database row.
     */
    private $row;
    /**
     * The array of users who are in this course.
     * @var User[]
     */
    private $users;
    /**
     * The array of users who are professors for this course.
     * @var User[] 
     */
    private $professors;
    /**
     * Gets a course given its unique id.
     * @param int $courseid The course id.
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:31,代码来源:course.php


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