Welcome Guest, Not a member yet? Register   Sign In
setting the base_url()
#2

(This post was last modified: 08-31-2021, 06:07 AM by captain-sensible. Edit Reason: added text )

For codeIgniter4

On Desktop using spark serve i set mine (app/config/App.php ) to:

public $baseURL = 'http://localhost:8080/';

ON Apache i set up to use 127.0.0.5

public $baseURL = 'http://127.0.0.5/';

for images ,depends where they are if relative to public directory then;
<img class ="img-fluid" src = "<?php echo base_url('images/logo.png'); ?>" >

// images is a directory inside public
so depends where assets dir is ; there are . See the difference in use between my code and yours. Also
note "/" at end of

public $baseURL = 'http://localhost:8080/';
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
setting the base_url() - by richb201 - 08-30-2021, 10:33 PM
RE: setting the base_url() - by captain-sensible - 08-31-2021, 06:03 AM
RE: setting the base_url() - by richb201 - 08-31-2021, 01:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB