This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

g.vanto67453
g.vanto67453

I have a simple page called 'main' (url=/), with the PHP code: <?php echo "hello world"; ?>

Upon accessing the page, getting following error (I'd include screenshot here but no feature to upload, urgh!)

syntax error, unexpected 'echo' (T_ECHO), expecting function (T_FUNCTION) or const (T_CONST) ~/themes/demo/pages/main.htm line 6

Eoler
Eoler

g.vanto67453 said: Upon accessing the page, getting following error syntax error, unexpected 'echo' (T_ECHO), expecting function (T_FUNCTION) or const (T_CONST) ~/themes/demo/pages/main.htm line 6

How about reading a bit of documentation first: https://octobercms.com/docs/cms/pages

g.vanto67453
g.vanto67453

My bad, I didn't RTFM! Cool, it works with:

function onStart() { $this['myVar'] = 'hello world'; }

daftspunky
daftspunky

Always RTFM lol :)

g.vanto67453
g.vanto67453

Will do!

So hey, couple of ideas for this forum (plugin?):

  • built in image uploads?
  • Way to mark a thread as closed (for me the OP at least). Or, (even better), a way to vote up a best answer (stack overflow style)

Otherwise, love the style of the October site eh, cheers!

daftspunky
daftspunky

Good tips, thanks!

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.