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 7717453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:54:10+00:00 2026-06-01T02:54:10+00:00

So I thought I’d write my first codeigniter helper (still new to codeigniter somewhat).

  • 0

So I thought I’d write my first codeigniter helper (still new to codeigniter somewhat). I needed something that would return an array of filenames from a photo directory to make hyperlinks to them. This was so I wouldn’t have to write out each filename myself, and adding new photos to the directory dynamically updated the site.

So I made a new helper called photo_helper.php which looks like this:

<?php 

    function spit_out_images($path)
    {
        $aryPhotos = get_filenames($path);

        //does parsing to create hyperlinks

        return $aryPhotos;
    }

I set the file and photo helper to autoload inside my autoload.php

Then in my view I called the helper function spit_out_images like so:

<?php
      $photoPath = base_url().'assets/_images/TwentyYears/thumbs';
      echo spit_out_images($photoPath);

?>

But I never get any results out. I even tried echoing out the $photoPath variable to make sure it was giving out the path correctly, which it was.

I’m sure it is something simple I’m missing, I just can’t figure it out.

Thank you!

  • 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-06-01T02:54:11+00:00Added an answer on June 1, 2026 at 2:54 am

    Make sure base_url() . 'assets/_images/TwentyYears/thumbs' has the correct permissions for Apache/PHP to execute and read the directory and files, 0755 should be an appropriate mode.

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

Sidebar

Related Questions

I thought calling Equals() on two empty Lists would return true, but that's not
I thought that there was some way in .net 3.0 to give an array
Thought I would ask the knowledgeable StackOverflow community a question that was on my
Thought I will point out first that I have looked around on Stackoverflow and
Who thought that styling a list of links could be so troublesome! First issue
I thought it would be simple but I still can't get it to work.
I thought that would have been simple but it is not working. I can,
I thought this would be a relatively simple task with something like FMOD, but
I thought that in principle Haskell's type system would forbid calls to impure functions
I thought I heard that py2exe was able to do this, but I never

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.