Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Extending theme with hyphen on folder name

Started by Muut Archive 11 years ago · 2 replies · 388 views
11 years ago

Is there a problem with themes that use hyphen on their folder name? I'm trying to extend gravstrap-theme, and getting:

TXT
Whoops \ Exception \ ErrorException (E_PARSE)
syntax error, unexpected '-', expecting '{'

My code:

PHP

<?php
   namespace Grav\Theme;
   use Grav\Common\Theme;
   class MyThemeName extends Gravstrap-Theme
{
}
---
11 years ago

Gravstrap-Theme is not a compatible class name. Php does not allow hyphens in the class name. Presuming you have the Gravstrap theme installed your class would look more like class MyThemeName extends GravstrapTheme (without a hyphen)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1999 9 years ago
Archive · by Muut Archive, 9 years ago
2 1342 9 years ago
Archive · by Muut Archive, 9 years ago
2 4549 9 years ago
Archive · by Muut Archive, 9 years ago
1 3402 9 years ago
Archive · by Muut Archive, 9 years ago
3 1493 9 years ago