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


PHP Track::all方法代碼示例

本文整理匯總了PHP中Track::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Track::all方法的具體用法?PHP Track::all怎麽用?PHP Track::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Track的用法示例。


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

示例1: function

    }
    return View::make('user.register');
});
Route::get('tracks/(:any)', function ($key) {
    $track = Track::where('urlkey', '=', $key)->take(1)->get();
    if (count($track) > 0) {
        return View::make('tracks.view')->with('track', $track);
    }
    return Response::error('404');
});
Route::get('/', function () {
    $track = new Track(array('admin' => 1, 'status' => 1, 'title' => 'Little Dragon - Twice (LSB Bootleg)', 'track_artist' => 1, 'urlkey' => 'djdjd^#*BXCB@!*#@&(SHS', 'result_purchase_url' => 'http://www.little-dragon.se', 'result_download_url' => 'http://www.little-dragon.se', 'player_download_url' => 'http://www.little-dragon.se'));
    //$track->save();
    $user = new User(array('username' => 'TheHydroImpulse', 'email' => 'dnfagnan@gmail.com', 'password' => 'password', 'salt' => 'd483jddj', 'banned' => false, 'activated' => true));
    //$user->save();
    $tracks = Track::all();
    return View::make('tracks.index')->with('tracks', $tracks);
});
/*
|--------------------------------------------------------------------------
| Application 404 & 500 Error Handlers
|--------------------------------------------------------------------------
|
| To centralize and simplify 404 handling, Laravel uses an awesome event
| system to retrieve the response. Feel free to modify this function to
| your tastes and the needs of your application.
|
| Similarly, we use an event to handle the display of 500 level errors
| within the application. These errors are fired when there is an
| uncaught exception thrown in the application.
|
開發者ID:niceboy120,項目名稱:Music-Platform,代碼行數:31,代碼來源:routes.php

示例2: isset

<table class="table-hover">
    <tr>
        <th><b><h3>Nombre</b></h3></th>
        <th><b><h3>Album</b></h3></th>
        <th><b><h3>Artista</b></h3></th>
        <th><b><h3>Duracion</b></h3></th>
        <th><b><h3>Tamaño</b></h3></th>
        <th></th>
    </tr>
    <?php 
$offset = isset($_GET['o']) ? $_GET['o'] : 0;
$num = Track::all(1000);
$numero_filas = Track::total();
?>
    <?php 
foreach (Track::all(10, $offset) as $track) {
    ?>
    <tr id='<?php 
    echo $track->TrackId;
    ?>
'>


      <td>
        <button  class='btn btn-default btn-sm button' type='button' onclick='modalEdit(<?php 
    echo utf8_encode($track->TrackId);
    ?>
)'><?php 
    echo $track->Name;
    ?>
</button>
開發者ID:stealthrob,項目名稱:Dangerous_Eagle,代碼行數:31,代碼來源:index.php

示例3: foreach

<table class="centered responsive-table striped">
    <tr>
        <th class="text-center">Nombre</th>
        <th class="text-center">Album</th>
        <th class="text-center">Artista</th>
        <th class="text-center">Duracion</th>
        <th class="text-center">Tama&ntilde;o</th>
        <th></th>
    </tr>
    <?php 
foreach (Track::all(10000) as $track) {
    ?>
        <tr>
            <td><a <?php 
    echo "href=panel/track.php?id='" . $track->TrackId . "'";
    ?>
 class="indigo-text text-darken-4"><?php 
    echo $track->Name;
    ?>
</a></td>
            <td><a <?php 
    echo "href=panel/album.php?id='" . $track->Album->AlbumId . "'";
    ?>
 class="teal-text text-lighten-1"><?php 
    echo $track->Album->Title;
    ?>
</a></th>
            <td><a <?php 
    echo "href=panel/artist.php?id='" . $track->Album->Artist->ArtistId . "'";
    ?>
><?php 
開發者ID:dev2me,項目名稱:music2.com,代碼行數:31,代碼來源:view.php


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