Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/02/2020, 15:55
Avatar de Triby
Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Arrays asociativos

No estás agregando la ruta:

Código PHP:
Ver original
  1. $respuestas = ModeloArticulos::mdlGetArticlesByAuthorId($authorId);
  2.        $ruta = 'img/articles/';
  3.  
  4.         $datos = array();
  5.         $i = 0;
  6.         foreach ($respuestas as $respuesta) {
  7.             $datos[$i] =
  8.                 array(
  9.  
  10.                     'articleId' => $respuesta["id"],
  11.                     'title' => $respuesta["title"],
  12.                     'content' => $respuesta["content"],
  13.                     // Solo concatena la ruta y listo!
  14.                     'photo_url' => $ruta . $respuesta["photo"]
  15.                 )
  16.                 $i++;
  17.  
  18.         }
  19.  
  20.         return $datos;
__________________
- León, Guanajuato
- GV-Foto