Welcome Guest, Not a member yet? Register   Sign In
How to send an image to a specific part of website?
#5

(02-07-2018, 03:56 AM)InsiteFX Wrote: You would need to save the image name and path to the database then do
a redirect back to the page with a refresh.

You would also need a method in the controller for loading the sidebar images
from the database.

(02-07-2018, 10:14 AM)InsiteFX Wrote: You can do it something like this its just an example:

PHP Code:
// -----------------------------------------------------------------------

/**
 * htmlImage
 * 
 * Place in a CI Helper
 * 
 * TODO: Add Eror Handling...
 */
if ( ! function_exists('htmlImage'))
{
 
   /**
     * htmlImage ()
     * -------------------------------------------------------------------
     *
     * $image = assign the database image path and name here
     * IE: http://www.yoursite.com/assets/images/image01.png
     * 
     * $alt   = 'Alt Image Name';
     * 
     * $data['image'] = htmlImage($image, $alt);
     * 
     * You can now access the image in the html view
     * 
     * <?php echo $image; ?>
     * 
     * @param  string $image
     * @param  string $alt
     * @return string
     */
    
function htmlImage(string $image ''string $alt '') : string
    
{
     
   $out '';

 
       $out .= '<img src="'.$image.'" alt="'.$alt.'" />';

        return 
$out;
    }


Read the comments.

Thank you so much sir  Big Grin god bless.
Reply


Messages In This Thread
RE: How to send an image to a specific part of website? - by rickyboy - 02-07-2018, 05:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB