Strange and basic problem |
[eluser]parham90[/eluser]
Hi, Personally, I thought this bit of code: Code: $this->load->view('add'); is the simplest piece of CI code. However, fate has decided to teach me better! I have a website, http://blindmoviebuff.freehostia.com that I am working on. I have put this file in the controllers folder, called movies.php. The contents go like this: <?php class Movies extends Controller { function Movies() { parent::Controller(); } function add() { $this->load->view('add'); } } [/code] However, typing this address: http://blindmoviebuff.freehostia.com/ind...movies/add gives me an empty page, with nothing in the HTML source. The question is, "why"? (please note that the file views/add.php exists) Thanks!
[eluser]WanWizard[/eluser]
Do you have a PHP error somewhere and error_reporting is disabled? What does CI itself log (set log_threshold in the config.php to 4 for debug logging)
[eluser]doangia[/eluser]
i think you should rename views/add.php to another name as add_view.php, tpl_view.php .etc..
[eluser]parham90[/eluser]
Hi, I did. This is the output, the very last line (there is no talk of the view being loaded and being sent to the user's browser, and so on): DEBUG - 2010-05-16 17:25:50 --> Controller Class Initialized Also, by views/add.php I meant in the views folder in the application, there is an add.php file. [quote author="WanWizard" date="1274033297"]Do you have a PHP error somewhere and error_reporting is disabled? What does CI itself log (set log_threshold in the config.php to 4 for debug logging)[/quote]
[eluser]mi6crazyheart[/eluser]
insert following piece of codes in u'r top section of add.php file & run. codes: ------ <?php error_reporting(E_ALL); ?> if any error will come then show us.
[eluser]parham90[/eluser]
Hi, When I did that, still nothing came up, so I decided that whatever it is that is wrong, it is in my view. I went, and this line was the problem (for future reference): Code: <?=form_input('name', set_value('name')); Note that the closing PHP tag (?> had been forgotten. Talk about great focus issues! :-) Thank you all for your help. It is very appreciated. |
Welcome Guest, Not a member yet? Register Sign In |