config_text in main_module

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Registered User
Posts: 6
Joined: Thu Oct 04, 2018 7:03 pm

config_text in main_module

Post by Trubs » Sat Oct 06, 2018 12:06 pm

How can I get access to config_text from main_module?

To config I get access like this:

Code: Select all

class main_module
	public $page_title;
	public $tpl_name;
	public $u_action;

	public function main($id, $mode)
		global $config;
There isn't a $config_text global variable :/

User avatar
Jr. Extension Validator
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: config_text in main_module

Post by GanstaZ » Sat Oct 06, 2018 1:14 pm

Add $phpbb_container and you can get it => $phpbb_container->get('config_text'); or what David said.
Last edited by GanstaZ on Sat Oct 06, 2018 2:44 pm, edited 1 time in total.
"When answer lies in the question,.. question becomes redundant!"

User avatar
Jr. Extension Validator
Posts: 15775
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood

Re: config_text in main_module

Post by david63 » Sat Oct 06, 2018 2:04 pm

Rather than using main_module it is easier to use a controller where you can inject whatever you need (also it will save you having to convert your module to a controller at some point in the future)
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: Bing [Bot], dmzx and 6 guests