Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:18:15+00:00 2026-05-28T00:18:15+00:00

If I have 10 images, 2 javascript files, and 4 css files that need

  • 0

If I have 10 images, 2 javascript files, and 4 css files that need to be included inside a Ci view… How is the best way to call all the files? I’ve tried calling all the external files using $this->load->view(‘image1.png’) and $this->load->view(‘style.css’). But it doesn’t seem to work properly. Any ideas on how to better approach this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:18:16+00:00Added an answer on May 28, 2026 at 12:18 am

    You’re not using the view method correctly there.
    You typically assign one view and pass things like js and css to the template. This can vary depending on how you use the framework.

    $this->load->view(‘path-to-view’); will look for a view in the view folder and not an arbitrary file.

    You might look into this:
    http://codeigniter.com/user_guide/helpers/html_helper.html#img

    for loading images, though I personally think it’s pointless to call a framework’s method for a basic html element like an image.

    There are cases when you would use multiple views, like views to be returned as strings – loops and such may need these – but that doesn’t look like the case in your question.
    Just in case though here’s the view docs:

    http://codeigniter.com/user_guide/general/views.html

    To elaborate further, the general idea is to use the CI controller to handle the data for your page, pass the necessary template data to the template (like your js and css specific to this page) then assign the necessary data to the view and pass that view to the template. You may be wondering what I mean by template too, since out of box CI loads views progressively if you just call them sequentially.

    in your controller you may pass the view an array of header info:

    $data['css'] = array('some-path.css','another-path.css');
    $this->load->view('your-view', $data);
    

    so in your view that handles the header you might call something like this:

    <head>
    <?php foreach($css AS $c): ?>
        <link rel="stylesheet" type="text/css" href="<?php echo $c; ?>">
    <?php endforeach; ?>
    </head>
    

    Here’s a fair link to CI templates:

    How to Deal With Codeigniter Templates?

    It’s a versatile framework with many options for using it however you are most comfortable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have moved a lot of images and javascript file that was inside class
For loading files like css or javascript of images, I have learned to add
Change all links that have an image in it to: javascript(alert(thehref)); eg. <a href=/galleries/anna-leah-111827/image01.html><img
I have images that need to scale to the screen's size. The images will
We are downloading web page linked Images, style sheet(.css) and javascript files using web
I need to reload the page after I've selected all images. I know that
I'm trying to setup django-compressor and django-staticfiles so that the compressed CSS/Javascript and images
I have a Javascript Map kit, and it use Image object to load images.
I have web application of which major part is javascript. I request images from
I have a script that uploads an image using JavaScript, as seen here .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.