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

Extending theme with hyphen on folder name

Started by Muut Archive 10 years ago · 2 replies · 340 views
10 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
{
}
---
10 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 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago