Documentation on settings.php

Documentation on settings.php

by Pedro Remedios -
Number of replies: 4

Hello,

I've looked all over but I can't find any explanation of mandatory code, best practices, etc. for settings.php for an activity module. The only thing available is other modules that have a settings.php file but the comments (or lack thereof) are not very helpful,

Please advise!

Best regards,

Pedro Remedios

Average of ratings: -
In reply to Pedro Remedios

Re: Documentation on settings.php

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Pedro,

Last year when I took over a couple of outdated plugins I found myself with the same problem. I just looked at a bunch of the settings files for other plugins, and mimicked what I saw in them, and just created settings for whatever I thought I needed.  I have also installed Code-checker and Moodle PHPdoc check which helped me clean up all my code and make it look like the rest of Moodle.

In reply to AL Rachels

Re: Documentation on settings.php

by Pedro Remedios -

That's where the problem is: All of them call extend_settings_navigation' but some call 'load_settings'. All I want to do is add a link to show the settings.php page.

In reply to Pedro Remedios

Re: Documentation on settings.php

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Pedro,

If you have an activity module and include a file named, settings.php, then Moodle will automatically add a link to settings.php and it will be at Administration > Site administration > Plugins > Activity modules > YourModulelName.

Average of ratings: Useful (1)