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


PHP Photo::getTitle方法代码示例

本文整理汇总了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;
 }
开发者ID:michalsanger,项目名称:cli-flickr-downloadr,代码行数:13,代码来源:FilenameCreator.php

示例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>";*/
开发者ID:GoranSubic,项目名称:smart-restoran,代码行数:31,代码来源:showUser.php


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