This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
HI, I have a question. Is it possible for only one record to be created in the plugin? So in the backend, when I click on the backend menu, I get a form and not a list of records.
milanblasko2844565 said: Is it possible for only one record to be created in the plugin? So in the backend, when I click on the backend menu, I get a form and not a list of records.
You can get creative with a settings model: https://octobercms.com/docs/plugin/settings
Thanks! And how I can show settings records in template file? I try insert as Record List but that return error
Type error: Too few arguments to function System\Behaviors\SettingsModel::get(), 0 passed and at least 1 expected
milanblasko2844565 said: Thanks! And how I can show settings records in template file?
Use Settings::instance()
as (singleton) reference, then access its fields:
{{ settings.property_name }} (Twig)
{{ $settings->property_name }} (PHP)
Thanks! Can I ask you where I insert Settings::instance(). Sorry for asking but I beginner.
1-5 of 5