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


PHP Web::service方法代码示例

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


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

示例1: printview_GET

function printview_GET(Web &$w)
{
    $p = $w->pathMatch("table", "id");
    $attachments = $w->service("File")->getAttachments($p['table'], $p['$id']);
    $w->ctx("attachments", $attachments);
    $w->setLayout(null);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:printview.php

示例2: atfile_GET

function atfile_GET(Web &$w)
{
    $p = $w->pathMatch("id");
    $id = str_replace(".jpg", "", $p['id']);
    $attachment = $w->service("File")->getAttachment($id);
    $w->sendFile(FILE_ROOT . $attachment->fullpath);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:atfile.php

示例3: attach_POST

function attach_POST(Web &$w)
{
    $table = $w->request('table');
    $id = $w->request('id');
    $title = $w->request('title');
    $description = $w->request('description');
    $type_code = $w->request('type_code');
    $url = str_replace(" ", "/", $w->request('url'));
    $object = $w->Auth->getObject($table, $id);
    if (!$object) {
        $w->error("Nothing to attach to.", $url);
    }
    $aid = $w->service("File")->uploadAttachment("file", $object, $title, $description, $type_code);
    if ($aid) {
        $w->ctx('attach_id', $aid);
        $w->ctx('attach_table', $table);
        $w->ctx('attach_table_id', $id);
        $w->ctx('attach_title', $title);
        $w->ctx('attach_description', $description);
        $w->ctx('attach_type_code', $type_code);
        $w->msg("File attached.", $url);
    } else {
        $w->error("There was an error. Attachment could not be saved.", $url);
    }
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:25,代码来源:attach.php

示例4: atthumb_GET

function atthumb_GET(Web &$w)
{
    $p = $w->pathMatch("id", array("w", 150), array("h", 150));
    $id = str_replace(".jpg", "", $p['id']);
    $attachment = $w->service("File")->getAttachment($id);
    require_once 'phpthumb/ThumbLib.inc.php';
    $thumb = PhpThumbFactory::create(FILE_ROOT . $attachment->fullpath);
    $thumb->resize($p['w'], $p['h']);
    //$thumb->adaptiveResize($p['w'], $p['h']);
    $thumb->show();
    exit;
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:12,代码来源:atthumb.php

示例5: atdel_GET

function atdel_GET(Web &$w)
{
    $p = $w->pathMatch("id", "url");
    $att = $w->service("File")->getAttachment($p['id']);
    if ($att) {
        $w->ctx('attach_id', $att->id);
        $w->ctx('attach_table', $att->parent_table);
        $w->ctx('attach_table_id', $att->parent_id);
        $w->ctx('attach_title', $att->title);
        $w->ctx('attach_description', $att->description);
        $att->delete();
        $w->msg("Attachment deleted.", "/" . str_replace(" ", "/", $p['url']));
    } else {
        $w->error("Attachment does not exist.", "/" . str_replace(" ", "/", $p['url']));
    }
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:16,代码来源:atdel.php


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