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


PHP Movie::getAllMovies方法代码示例

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


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

示例1: index

 public function index($message = '')
 {
     $movie = new Movie();
     $movies = $movie->getAllMovies();
     if (count($movies) === 0) {
         $movies = -1;
     }
     $this->registry->template->show('movies', array('movies' => $movies, 'type' => 'title', 'val' => '', 'message' => $message));
 }
开发者ID:a-melnichuk,项目名称:mymvc,代码行数:9,代码来源:moviesC.php

示例2: function

    return $response;
});
$app->post('/login', function ($request, $response, $args) {
    $data = $request->getParsedBody();
    $user = new User(db::getInstance());
    $result = $user->checkUser($data['username'], $data['password']);
    if ($result === false) {
        $response->write(json_encode(array('error' => array('message' => 'Wrong login information.'))));
    } else {
        $response->write(json_encode(array('token' => $result)));
    }
    return $response;
});
$app->get('/movies', function ($request, $response, $args) {
    $movie = new Movie(db::getInstance());
    $result = $movie->getAllMovies();
    if ($result === false) {
        $response->write(json_encode(array('error' => array('message' => 'No records found.'))));
    } else {
        $response->write(json_encode($result));
    }
    return $response;
})->add($auth_mw);
$app->get('/catmail/{email}', function ($request, $response, $args) {
    $recipient = $args['email'];
    //Unfortunately, mail transport is used instead of smtp, since smtp is unavailable for free on my server
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject('Your subject')->setFrom(array('catmail@a-melnichuk-projects.hol.es' => 'Cat Mail'))->setTo(array($recipient))->setBody('<html>' . '<head></head>' . '<body>' . 'Here is an image of cute kitty: <img src="' . $message->embed(Swift_Image::fromPath('http://a-melnichuk-projects.hol.es/res/cutecat.jpg', 'image/jpeg')) . '" alt="Cat Pic" />' . 'It\'s adorable!' . '</body>' . '</html>', 'text/html')->attach(Swift_Attachment::fromPath('http://a-melnichuk-projects.hol.es/res/cutecat.jpg', 'image/jpeg'));
    $result = $mailer->send($message);
开发者ID:a-melnichuk,项目名称:SlimAuthTest,代码行数:31,代码来源:index.php

示例3: getHTMLTable

<?php

// we now in presentation layer
// we will include business layer to load business logic
include 'model/movie.php';
// init Movie Model from Business Logic
$movie = new Movie();
// now load all Movies
$data = $movie->getAllMovies();
// prepare HTML Table
function getHTMLTable($tabledata)
{
    $html = '<br />';
    $html .= '<h1>Liste der bereits erstellten Filme:</h1>';
    $html .= '<table id="moviestable">';
    $html .= '<thead><tr>';
    $html .= '<th>Filmtitel</th>';
    $html .= '<th>Jahr</th>';
    $html .= '<th>Sprache</th>';
    $html .= '<th>Medium</th>';
    $html .= '<th>E-Mail</th>';
    $html .= '</tr></thead>';
    foreach ($tabledata as $movie) {
        $html .= '<tbody><tr>';
        $html .= '<td>' . $movie['name'] . '</td>';
        $html .= '<td>' . $movie['year'] . '</td>';
        $html .= '<td>' . $movie['language'] . '</td>';
        $html .= '<td>' . $movie['medium'] . '</td>';
        $html .= '<td><a href="mailto:' . $movie['email'] . '">' . $movie['email'] . ' </a></td>';
        $html .= '</tr></tbody>';
    }
开发者ID:schreisi14,项目名称:movieDBitm14,代码行数:31,代码来源:movies.php


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