Closed olissongs closed 6 years ago
working actual yii2 2.013 stable
Hi @olissongs !
working actual yii2 2.013 stable
Does it mean that it work with that version, or it's the version of framework which doesn't work for you?
Thanks!
Hi, i wanted to say i'm working with yii2.0.13.1, the general things are working. But the thing with the plugin "definedlinks" wont work.
but i cant say is it an understanding problem on my side, or a bug or a missing documentation thing.
its only the definedlinks thing that i didnt get to run. hope you can help. thanks
@olissongs I got it, thanks!
So here is the solution:
view.php
<?= \vova07\imperavi\Widget::widget([
'name' => 'redactor',
'settings' => [
'plugins' => ['definedlinks'],
'definedLinks' => \yii\helpers\Url::to(['site/predefined-links']), // This is very important because it doesn't work with specific JSON or array. It always try to fetch data from specified link.
],
]); ?>
SiteController
(Just because I use this controller in my example)public function actionPredefinedLinks()
{
return json_encode(
[
[
'name' => 'Select...',
'url' => false,
],
[
'name' => 'Google',
'url' => 'http://google.com',
],
[
'name' => 'Home',
'url' => '/',
],
[
'name' => 'About',
'url' => '/about/',
],
[
'name' => 'Contact',
'url' => '/contact/',
],
]
);
}
Hope it will be useful for you. Feel free to re-open this issue in case you need it. Good luck!
Yes this works fine! thank you
Hi, is there a possibility to configure in the widget the predefined links? https://imperavi.com/redactor/plugins/definedlinks/
parameter 'defined-links' or 'definedlinks', no result
thats in a view.php
thats in website html-source-code
no links shown, any ideas?