Created page_theme.php and immediately this happens "syntax error, unexpected 'namespace' (T_NAMESPACE)"

Permalink
Hey dudes,

I have been trying to concretize Oleose, a bootstrap3 theme. So far so good. However, as soon as I copy the page_theme.php into my Application\Themes\oleose folder I get the above.

the file has the following contents and nothing more:
<? php
namespace Application\Theme\Oleose;
class PageTheme extends \Concrete\Core\Page\Theme\Theme; {
}


site runs
PHP Version 5.4.17
c5 version 5.7.3.1

Is this an autoloader problem? Should I redeclare the namespace somewhere? I've done a bit of reading, however, none c5 specific and I feel I don't posess the required c5core_mastery_level needed to resolve this thing.

Thanks for the help guys.

Best,
Matus

yoga
 
jakobfuchs replied on at Permalink Reply
jakobfuchs
Remove the semicolon?
yoga replied on at Permalink Reply
yoga
Nah, unfortunately, but thanks for pointing it out anyway, jakob!
I must add I have tried several versions of that piece of code, suggested here on forums. I did turn off cache settings immediately after a fresh c5 install too. I am just perplexed at how this might be happening, since I used that theme without trouble so far, only after I add the namespace in the page_theme does the error come up (on every page). Since that code is pretty standard concrete5 code and my php version is 5.3+ I have a hard time finding any related namespace issues out there, that's why I started suspecting c5. I am not saying human factor isn't the most suspicious one of all possible causes at the moment, but I probably won't know enough about php by tomorrow morning either, which sucks. :)

Renaming the namespace is probably not a good idea?

btw. I did a pretty standard 3.5.7.1 install, no core changes whatsoever.
jakobfuchs replied on at Permalink Best Answer Reply
jakobfuchs
Remove the space in the php Tag?

<? php
yoga replied on at Permalink Reply
yoga
Oh.. That did it. Thanks! :)
When I was a little kid, my mom took me to fair and I ate too many sweets and drank too much juice and we could not find any public toilets, so, long story short, I shat myself in front of a big crowd. This feels very distantly like that, hugely embarrassing... :)