rename some methods
This commit is contained in:
		
							parent
							
								
									8272de705b
								
							
						
					
					
						commit
						7baf1bdcf3
					
				| @ -85,8 +85,8 @@ final class RecipeController | ||||
|         $O_recipe = RecipeModel::getRecipeByID($A_urlParams[0]); | ||||
| 
 | ||||
|         header("Content-Type: image"); | ||||
|         if (isset($O_recipe) && $O_recipe->getImage() !== null) { | ||||
|             echo $O_recipe->getImage(); | ||||
|         if (isset($O_recipe) && $O_recipe->queryImg() !== null) { | ||||
|             echo $O_recipe->queryImg(); | ||||
|         } else { | ||||
|             echo file_get_contents(Constants::rootDir()."/static/img/default_recipe.jpg"); | ||||
|         } | ||||
|  | ||||
| @ -81,7 +81,7 @@ final class RecipeModel | ||||
|         return self::createFromRow($row, $I_id); | ||||
|     } | ||||
| 
 | ||||
|     public function getImageLink(){ | ||||
|     public function getImgLink(){ | ||||
|         return '/static/img/recipes/'.$this->I_ID; | ||||
|     } | ||||
| 
 | ||||
| @ -89,7 +89,7 @@ final class RecipeModel | ||||
|         return '/recipe/view/'.$this->I_ID; | ||||
|     } | ||||
| 
 | ||||
|     public function getImage(){ | ||||
|     public function queryImg(){ | ||||
|         $O_model = Model::get(); | ||||
|         $stmt = $O_model->prepare("SELECT IMG FROM RECIPE WHERE ID=:id"); | ||||
|         $stmt->bindParam("id", $this->I_ID); | ||||
|  | ||||
| @ -111,7 +111,7 @@ final class UserModel extends UserSessionModel | ||||
|         $stmt->execute(); | ||||
|     } | ||||
| 
 | ||||
|     public function getProfilePic(){ | ||||
|     public function queryProfilePic(){ | ||||
|         $O_model = Model::get(); | ||||
|         $stmt = $O_model->prepare("SELECT PROFILE_PIC FROM USER WHERE ID=:id"); | ||||
|         $stmt->bindParam("id", $this->I_ID); | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| $O_recipe = $A_view["RECIPE"]; | ||||
| ?>
 | ||||
| <a href="<?= $O_recipe->getLink() ?>"> | ||||
|     <img src="<?= $O_recipe->getImageLink() ?>" alt="<?= $O_recipe->S_NAME ?>"> | ||||
|     <img src="<?= $O_recipe->getImgLink() ?>" alt="<?= $O_recipe->S_NAME ?>"> | ||||
|     <section> | ||||
|         <h2> <?= $O_recipe->S_NAME ?> </h2>
 | ||||
|         <p> <?= $O_recipe->queryNote() ?> </p>
 | ||||
|  | ||||
| @ -4,7 +4,7 @@ $O_recipe = $A_view["RECIPE"]; | ||||
| <main> | ||||
|     <?php View::show("common/category_list") ?>
 | ||||
|     <article> | ||||
|         <img src="<?= $O_recipe->getImageLink() ?>" alt="Image d'illustration de la recette"> | ||||
|         <img src="<?= $O_recipe->getImgLink() ?>" alt="Image d'illustration de la recette"> | ||||
| 
 | ||||
|         <section class="infosRecette"> | ||||
|             <header> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user