Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Reading site.yaml or page frontmatter as a variable in plugin

Started by Claud Rusnac 9 years ago · 1 replies · 926 views
9 years ago

I have a config in my site.yaml file:

TXT
git_changelog: https://domain.com/api/v3/repos/repo/releases

and I want to read it in as a variable in my plugin. I tried to use:

PHP
$config = $grav['config']->get('site.git_changelog');

but get an error.

9 years ago

Listing the error would help, but this works in 1.4.1: $this->grav['config']->value('site.title'). Or, if you need to return it in a static function, for example when called by a blueprint: Grav::instance()['config']->value('site.title').

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 8 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago