![]() |
Can't get a view to load - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can't get a view to load (/showthread.php?tid=53334) Pages:
1
2
|
Can't get a view to load - El Forum - 07-19-2012 [eluser]OldRodKS[/eluser] I am really new to CI, so I'm sure I am missing something really basic here... but I cannot get a view to load when I call a function directly from a URL. I am working on a user registration system. The system sends an email to the user with an activation URL that looks like this: Code: http://localhost/ci_bannor/register/email_verification/6b84c572efd Inside my register.php controller, I have a function called "email_verification" that is shown below: Code: public function email_verification() { I put echo statements in here at various places to track down what's going on. $verifcode is getting the proper part of the URL like it should. When I have a code there, I can echo it out. When it's not there, it goes into the if block like it should, but it simply won't load the view. I don't get an error, it just doesn't load. What am I doing wrong? Can't get a view to load - El Forum - 07-19-2012 [eluser]TWP Marketing[/eluser] Code: $this->load->view("vVerifyError", $data); Do you have the var $data defined? I realize you are not posting all the function code, but that could cause a problem if not defined in your controller function Can't get a view to load - El Forum - 07-19-2012 [eluser]OldRodKS[/eluser] Yes, $data was defined, but I've been removing stuff trying to get down to the root of the problem. The line posted above should not have the ",$data" in it. It still doesn't work though ![]() Can't get a view to load - El Forum - 07-19-2012 [eluser]TWP Marketing[/eluser] Code: public function email_verification() { The uri function segment() returns FALSE, so your if statement will miss it if the verify code is not in your URL. Try Code: ... Can't get a view to load - El Forum - 07-19-2012 [eluser]OldRodKS[/eluser] No change. Here is how it looks now: Code: public function email_verification() { The echo statement displays whether it's =FALSE or ='', but with or without the echo statement, the view doesn't load. Can't get a view to load - El Forum - 07-19-2012 [eluser]TWP Marketing[/eluser] Then the suspicion falls on the view code itself. Could you change the view name to some other view which you know does work, as a test. If it displays then please post the view code itself so we can debug from there. Can't get a view to load - El Forum - 07-19-2012 [eluser]OldRodKS[/eluser] OK, changed it to display my page footer: $this->load->view('vPgFooter') This is a view I use on every page and it works fine on all the other pages. It does not work when called in the code above. Then I called the vVerifyError view from my main page and it displays fine, so the view itself is ok. email_verification is part of my register controller. Could it have something to do with calling it via a URL? Can't get a view to load - El Forum - 07-19-2012 [eluser]TWP Marketing[/eluser] I don't see how the URL would effect the use of the loader to move it to the browser. You said there were not errors, I assume neither php error log nor the server error log have anything? You get a blank screen? usually my server will glitch and report a problem on a blank screen. Can't get a view to load - El Forum - 07-19-2012 [eluser]TWP Marketing[/eluser] another point, using a subview like your footer means that the rest of the html code is missing, hence a blank screen. Is the verify page a full html document, with html header data? Can't get a view to load - El Forum - 07-19-2012 [eluser]OldRodKS[/eluser] No errors in php log or apache server log. Is there a codeigniter error log file someplace? |