www.webdeveloper.com
Results 1 to 5 of 5

Thread: Adding logic to the controller

  1. #1
    Join Date
    May 2013
    Posts
    4

    resolved Adding logic to the controller

    I am going thru tutorial in Codeigniter and in the Tutorial − Static pages, I am unable to understand the last sentence ...In order to load those pages, you'll have to check whether the requested page actually exists in the part adding logic to the controller. A code is given under the sentence and I don't know what to do with it. Can someone explain please?

  2. #2
    Join Date
    Jun 2013
    Posts
    4
    As far as i understand you need to check if a view exists before loading it via the controller

    Example
    if (file_exists(APPPATH."views/my_view.php"))
    {
    $this->load->view("my_view");
    }

  3. #3
    Join Date
    May 2013
    Posts
    4

    resolved Static pages

    Thank u very much. I will check it.

  4. #4
    Join Date
    May 2013
    Location
    London, UK
    Posts
    16
    Basically what they're saying is add code to your controller so that you can see it's working. For example, your welcome controller (the default) has code within the index() method and by loading that, you can see it output on your browser. That shows it's working.

  5. #5
    Join Date
    May 2013
    Posts
    4
    Thanks so much. I have understood this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles