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


PHP Artist::find方法代碼示例

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


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

示例1: removeArtist

 public function removeArtist($id)
 {
     $artist = Artist::find($id);
     $name = $artist->name;
     $artist->delete();
     return Redirect::route('account')->with('status', 'alert-success')->with('global', 'You just deleted ' . $name);
 }
開發者ID:mlauren,項目名稱:midway-gallery,代碼行數:7,代碼來源:ArtistController.php

示例2: header

<?php

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

示例3: show

 public function show()
 {
     if ($this->params()->name) {
         $this->artist = Artist::where(['name' => $this->params()->name])->first();
     } else {
         $this->artist = Artist::find($this->params()->id);
     }
     if (!$this->artist) {
         $this->redirectTo(['#create', 'name' => $this->params()->name]);
     } else {
         $this->redirectTo(['wiki#show', 'title' => $this->artist->name]);
     }
 }
開發者ID:JCQS04,項目名稱:myimouto,代碼行數:13,代碼來源:ArtistController.php

示例4: artistPage

 /**
  * 藝術家頁麵
  *
  * @param int $id
  * @return Response
  */
 public function artistPage($id)
 {
     // fetch artist
     $artist = Artist::find($id);
     // collect the total counts
     $total = [];
     foreach ($artist->programs as $pm) {
         empty($total[$pm->dates->year]) and $total[$pm->dates->year] = 0;
         $total[$pm->dates->year]++;
     }
     $total = self::fillChartData($total);
     // TDK
     $title = $artist->name;
     $description = '飛魚秀歌曲歌手, 飛魚秀音樂藝人';
     return View::make('music.artist')->with('artist', $artist)->with('total', $total)->with('title', $title)->with('description', $description);
 }
開發者ID:popfeng,項目名稱:zao,代碼行數:22,代碼來源:MusicController.php

示例5: header

<?php

include 'models.php';
if (isset($_POST['id'])) {
    $a = Artist::find($_POST['id']);
    $a->Name = $_POST['name'];
    if ($a->save()) {
        header("Location: " . "artist.php?id=" . $a->ArtistId);
    }
} else {
    $a = Artist::create($_POST['name']);
    if ($a->save()) {
        header("Location: " . "artist.php?id=" . $a->ArtistId);
    }
}
開發者ID:stealthrob,項目名稱:Dangerous_Eagle,代碼行數:15,代碼來源:guardar_artist.php

示例6: api_get_artist_by_id

 public function api_get_artist_by_id($artist_id)
 {
     $artist = Artist::find($artist_id);
     return Response::json($artist);
 }
開發者ID:ariftechnologies,項目名稱:musicStore,代碼行數:5,代碼來源:MusicStoreController.php

示例7: isset

		
		var uno = !!document.forms["formulario"]["name"].value; //Esta es la representación booleana de la cadena
		if (  
			uno &&  
			(isNaN(document.forms["formulario"]["name"].value)) 
			) {
			return true;
		}else{
			return false;
		};
		
	}
</script>
<?php 
include 'models.php';
$artist = isset($_GET['id']) ? Artist::find($_GET['id']) : Artist::create(null);
?>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
	<title>New Artist</title>
</head>
<body>
	

<div class="container">
<div class="jumbotron">
	<h1>Nuevo Artista</h1>
</div>
<div class="row"> <!--Sección para hacer el formulario en medio de la pantalla-->
開發者ID:stealthrob,項目名稱:Dangerous_Eagle,代碼行數:30,代碼來源:artist.php

示例8: alias_name

 public function alias_name()
 {
     $name = '';
     if ($this->alias_id) {
         try {
             $name = Artist::find($this->alias_id)->name;
         } catch (Rails\ActiveRecord\Exception\RecordNotFoundException $e) {
         }
     }
     return $name;
 }
開發者ID:JCQS04,項目名稱:myimouto,代碼行數:11,代碼來源:Artist.php


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