HMVC and Layout = problems |
[eluser]groyk[/eluser]
Hi Guys I have a BIG problem with all my pages generated with CI. I use HMVC and a layout class In ALL my pages I get either -- or --- as the first charters in all pages witch is really annoying. I believe this is why my app can't run at my production server! See error message below Quote:A PHP Error was encountered Here is the first 2 lines of one of my pages Code: -- I don't know if it can be an encoding problem, but it seems like I have the same problem with both my development server and my production server! Layout class: Code: <?php Hoping that someone can help me out!
[eluser]tomcode[/eluser]
Guess it's a whitespace problem. Take out the closing PHP tags, check on white spaces before opening tags.
[eluser]groyk[/eluser]
[quote author="tomcode" date="1264391605"]Guess it's a whitespace problem. Take out the closing PHP tags, check on white spaces before opening tags.[/quote] Hi tomcode Thank´s for your advice, i will try that. About the closing PHP tags, should they be removed in all files. If not. witch files?
[eluser]tomcode[/eluser]
You don't need them but they don't bother ... as long as You don't have a white space after them.
[eluser]groyk[/eluser]
Hi tomcode I've now removed ALL php closing tags from my project. It has removed almost all the weird charters. But still I have a few I just can't get rid off!! Is there other things to check?
[eluser]tomcode[/eluser]
1. You need to check whether You have white spaces / line feeds BEFORE PHP opening tags at the beginning of files 2. Remember: everything outside an opening PHP tag will be sent to the browser 3. You mention now weird chars Quote:... It has removed almost all the weird charters ... What do You mean by that ?
[eluser]groyk[/eluser]
Hi Attached picture shows one of the places where the problem appears! The code that generates this output is shown below. Master View (from Layout library) Code: <div id="sidebar"><?=modules::run('base/main_menu')?></div> Controller base/main_menu Code: function main_menu() Sub View for main_menu Code: <?=@$menu?>
[eluser]tomcode[/eluser]
Maybe this file (main_menu.php) is UTF-8 encoded with BOM, some browsers can't deal with that.
[eluser]groyk[/eluser]
Tried to encode all files to UTF-8 without BOM. But It still don't change anything!! Is there a way to encode a dir including all subdirs? I am Using WAMP on a winbox. Maybe the problem is there anywhere OR?
[eluser]groyk[/eluser]
Hmm. I just can't figure it out. Here is a link to my app. I someone want to see the problems! www.smartkant.dk/ci_erp.zip User: admin Pass: admin User: test Pass: test Remark this link is only for a pre pre alpha release! |
Welcome Guest, Not a member yet? Register Sign In |