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


PHP Track::find方法代碼示例

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


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

示例1: isset

<script type="text/javascript">
$(document).ready(function(){

});
</script>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap-select.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  <script src="bootstrap-select.js"></script>
<?php 
include 'models.php';
$track = isset($_GET['id']) ? Track::find($_GET['id']) : Track::create(null, null, 0, 0, 0, 1);
?>



	
</head>
<body>
<div class="jumbotron" >
<div class="container"><?php 
if (isset($track->TrackId)) {
    ?>
			<h1>Track</h1>
			<?php 
} else {
    ?>
開發者ID:stealthrob,項目名稱:Dangerous_Eagle,代碼行數:31,代碼來源:track.php

示例2: intval

<?php

include 'models.php';
if (isset($_POST['id'])) {
    $a = Track::find($_POST['id']);
    $a->Name = $_POST['name'];
    $a->Album = intval($_POST['album']);
    $a->Composer = $_POST['composer'];
    $a->Milliseconds = $_POST['milliseconds'];
    $a->Bytes = $_POST['bytes'];
    $a->UnitPrice = $_POST['unitprice'];
    if ($a->save()) {
        header("Location: " . "../index.php?id=" . $a->TrackId);
    }
} else {
    $a = Track::create($_POST['name'], $_POST['composer'], $_POST['milliseconds'], $_POST['bytes'], $_POST['unitprice'], intval($_POST['album']));
    if ($a->save()) {
        header("Location: " . "../index.php?id=" . $a->TrackId);
    }
}
開發者ID:dev2me,項目名稱:music2.com,代碼行數:20,代碼來源:guardar_track.php

示例3: header

<?php

include 'models.php';
if (isset($_GET['id'])) {
    $a = Track::find($_GET['id']);
    if ($a->delete()) {
        header("Location: index.php");
    }
} else {
    header("Location: index.php");
}
開發者ID:stealthrob,項目名稱:Dangerous_Eagle,代碼行數:11,代碼來源:borrar_track.php

示例4: api_get_track_by_id

 public function api_get_track_by_id($track_id)
 {
     $track = Track::find($track_id);
     $data = array('id' => $track_id, 'name' => $track->name, 'artist_name' => $track->artist->name, 'album_name' => $track->album->name);
     return Response::json($data);
 }
開發者ID:ariftechnologies,項目名稱:musicStore,代碼行數:6,代碼來源:MusicStoreController.php


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