/    Sign up×
Community /Pin to ProfileBookmark

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 …[I]In order to load those pages, you’ll have to check whether the requested page actually exists[/I] in the part [B]adding logic to the controller[/B]. A code is given under the sentence and I don’t know what to do with it. Can someone explain please?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@seed4uJun 03.2013 — 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");

}
[/QUOTE]
Copy linkTweet thisAlerts:
@jubsastryauthorJun 05.2013 — Thank u very much. I will check it.
Copy linkTweet thisAlerts:
@rossytzoltanJun 05.2013 — 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.
Copy linkTweet thisAlerts:
@jubsastryauthorJun 06.2013 — Thanks so much. I have understood this.
×

Success!

Help @jubsastry spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...