0

On a relatively straightforward concrete5 website, I have the following code:

        $a = new Area('Full width');
        $a->display($c);

The second line is breaking the page, but I cannot work out why. If you comment it out the page is rendered (clearly without the content showing), with it the page is completely blank (nothing in the source at all).

There's nothing relevant in either the concrete5 log, or the php error log and I'm all out of ideas of how to find out what could have gone wrong (which I can only assume is a data issue as the rest of the website is fine).

I'm hoping someone may have experienced something similar with ideas on how to debug or diagnose this.

(this is not a duplicate of other more generic "php white screen of death" - I have followed these and they do not have the answer to this, probably more specific, question)

Paul
  • 9,409
  • 13
  • 64
  • 113

2 Answers2

0

If you're on a newer version of C5 try without the $c as that's not necessary anymore and might cause a problem depending on your PHP settings.

Nour Akalay
  • 429
  • 3
  • 4
0

You shouldn't use the global $c anymore (you don't say what version) but set it explicitly:

$c = \Page::getCurrentPage();

Also, you can try this (view the source after page render):

// $a->display($c);    
echo '<!--<pre>'. print_r($c, 1). '</pre>-->';

You should also turn on debugging during development (Output error info & Show debug):

http://yoursite.com/index.php/dashboard/system/environment/debug

@Nour - I thought the $c should not be used with Global Areas only...