本文整理汇总了PHP中Photo::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::getTitle方法的具体用法?PHP Photo::getTitle怎么用?PHP Photo::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo::getTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTitle
/**
* @param \FlickrDownloadr\Photo\Photo $photo
* @param boolean $noTitleSlug
* @return string
*/
private function getTitle(Photo $photo, $noTitleSlug)
{
$title = $photo->getTitle();
if (!$noTitleSlug) {
$title = \Nette\Utils\Strings::webalize($title);
}
return $title;
}
示例2: UserDAO
$connection = $dbConn->connectToDB();
$userDao = new UserDAO();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$upload_dir_url = "/photo/user";
$uploaddir = DIR_LOC . $upload_dir_url . "/";
//$uploaddir = '/smart2015/smart-restoran/photo/user/';
$uploadfile = $uploaddir . basename($_FILES['pic_1']['name']);
//if(isset($_POST['pic_1'])){
if (move_uploaded_file($_FILES['pic_1']['tmp_name'], $uploadfile)) {
//echo "File is valid, and was successfully uploaded.\n";
$target_file = basename($_FILES['pic_1']['name']);
$file_name = $target_file;
$target_file_url = URL_PROJECT . $upload_dir_url . "/" . $target_file;
$photo = new Photo();
$photo->setTitle($file_name);
$sql = "INSERT INTO photo SET title = '" . $photo->getTitle() . "';";
echo "File name je sada: " . $file_name;
if (!($results = $connection->query($sql))) {
die('Ne mogu da izvrsim upit zbog [' . $connection->error . "]");
}
$photo_id = mysqli_insert_id($connection);
echo "Photo ID posle inserta iznosi: {$photo_id}";
} else {
echo "Postoji problem ili niste odabrali sliku za svoj profil.<br />";
echo "Možete upload-ovati fotku kada to budete želeli.<br />";
/*echo '<pre>';
echo "Possible file upload attack!\n";
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";*/