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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:53:24+00:00 2026-05-24T02:53:24+00:00

I have a model with two functions, like this: <?php class FotoModel extends CI_Model

  • 0

I have a model with two functions, like this:

<?php

class FotoModel extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }

    function getFotosByCat($cat)
    {
        $this->load->helper("file");
        switch($cat)
        {
            case "bloemen" : return get_filenames("/images/foto/bloemen/");
            case "dieren" : return get_filenames("/images/foto/dieren/");
            case "andere" : return get_filenames("/images/foto/andere/");
        }
    }

    public function getFotoLinksByCat($cat)
    {
        $fileNames = getFotosByCat($cat);
        //i do stuff with $fileNames and provide a return statment..
    }
}

?>

I load the model in my controller and tested the second method with some static data for $fileNames and everything works fine. Only when I make a call to the first function (the one with the switch/case statement) from the second (as seen in the code-example) I get an error.

And the thing is I don’t even get to see what kind of error. It is because of testing and trying that I know the error MUST be in the first function. Anyone that can help me to solve this one?

  • 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-24T02:53:24+00:00Added an answer on May 24, 2026 at 2:53 am

    Try:

    $fileNames = $this->getFotosByCat($cat);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CI Model set up with this function and ActiveRecord: function get_open_competitions()
I have 3 django models (simplified for this example): class Fighter (models.Model): name =
I have these two models: class Application_Model_List extends Zend_Db_Table_Abstract { protected $_name = 'list';
I have a ui that looks like this: +--------+---------------+ | model1 | model details
I have two PHP scripts. One acts as a backend, and contains a class
I have a blog-like application with stories and categories: class Category(models.Model): ... class Story(models.Model):
I have a model which have a function to calculate the difference between two
I have a hibernate model with two classes, let's say A and B. B
I have a simple data model of two tables, email and recipients, email can
I have a Django model TimeThingie with two TimeField s called t1 and t2

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.