@nakome
I have checked it.
The reason why this issue is reproduced is because the page content where shortcode is placed with logic is cached and that's why you may not see actual result after form submit. if there doesn't exists some others issues with logic inside your plugin. but adding this
Config::set('system.pages.flush_cache', true);
or
Action::add('plugins_loaded', function () {
Config::set('system.pages.flush_cache', true);
});
must resolved this issue. because its says to Morfy Pages that page is updated and new unique cache must be created for it. But in your plugin for some reason its not works. Need more time on investigate of this issue.
My recomendation: dont use shortcode for this plugin. Create a Tempalte function for templates. for e.g. https://github.com/morfy-cms/morfy-plugin-contact/blob/master/contact.php and template usage is
{Contact::form()}
or procedure style
function poll() {
}
and usage in template
{poll()}
@/all
Default Theme in Morfy 2.0.2 use BOWER http://bower.io
And if your are using composer or github clone to install Morfy
then You also need to install vendors for Default Theme by running in console
bower install
from default theme directory
Action::add('before_page_rendered', function() {
$template = Pages::getCurrentTemplate();
$template->assign('var', 'value');
});
{Youtube name="nakome"}
{Youtube name="nakome" limit="4"}
to get only last 4 videos