Welcome Guest, Not a member yet? Register   Sign In
Cannot display images in CodeIgniter
#21

You cannot load images from the project folder it is .htaccess protected.

Code:
<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

This is where you should be loading your resources.

PHP Code:
<?= $this->extend('layouts/default'?>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#22

Thanks. But how can I load images and CSS this way?
Reply
#23

Check out IncludeBeer's Web Site and look at his 4 part Creating a multilingual website with CodeIgniter 4
Start with 1 and work through to 4 look at how he is doing the layouts and templates.

IncludeBeer - Creating a multilingual website with CodeIgniter 4
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#24

(This post was last modified: 07-16-2023, 12:42 AM by kenjis.)

By the way, what web server do you use? Apache?
And where is the document root?

Doesn't the docs help you?
https://codeigniter4.github.io/CodeIgnit...nning.html
Reply
#25

Yes, Apache. This is exactly what I was looking for! Thanks!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB