Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon layout template undefined when using user template #113

Merged
merged 1 commit into from Jan 7, 2015

Conversation

gael-wogenstahl
Copy link
Contributor

When overriding at least one layout template, the plugin does not load the default layout templates into the layoutTemplates array. In that case, the icon layout is not retrieved correctly in setCaption function since it tries to access the layoutTemplates array instead of using the getLayoutTemplate function.

This issue can be reproduced with http://demos.krajee.com/widget-details/fileinput by setting the layoutTemplates option as follow:

echo FileInput::widget([
    'pluginOptions' => [
        'layoutTemplates' => ['main1' => "{preview}\n<div class=\"kv-upload-progress hide\"></div>\n<div class=\"input-group {class}\">\n{caption}\n<div class=\"input-group-btn\">\n{remove}\n{cancel}\n{upload}\n{browse}\n</div>\n</div>"]
    ]
]);

When overriding at least one layout template, the plugin does not load the default layout templates into the layoutTemplates array. In that case, the icon layout is not retrieved correctly in setCaption function since it tries to access the layoutTemplates array instead of using the getLayoutTemplate function.

This issue can be reproduced by setting the layoutTemplates option as follow:
'layoutTemplates' => ['main1' => "{preview}\n<div class=\"kv-upload-progress hide\"></div>\n<div class=\"input-group {class}\">\n{caption}\n<div class=\"input-group-btn\">\n{remove}\n{cancel}\n{upload}\n{browse}\n</div>\n</div>"]
kartik-v added a commit that referenced this pull request Jan 7, 2015
Icon layout template undefined when using user template
@kartik-v kartik-v merged commit 4fe169e into kartik-v:master Jan 7, 2015
@kartik-v kartik-v added bug and removed enhancement labels Jan 7, 2015
kartik-v added a commit that referenced this pull request Jan 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants