yii2 imperavi widget
1.0.0
Imperavi Redactor Widget是Imperavi Redactor 10.2.5(高质量Wysiwyg编辑器)的包装器。
请注意,Imperavi redactor本身是专有商业版权软件,但是由于YII社区购买了OEM许可,因此您可以免费使用YII。
安装此扩展程序的首选方法是通过作曲家。
要么运行
$ php composer.phar require --prefer-dist vova07/yii2-imperavi-widget " * "或添加
"vova07/yii2-imperavi-widget" : " * "要为composer.json文件的require部分。
安装扩展名后,只需在代码中使用它:
echo vova07 imperavi Widget:: widget ([
' name ' => ' redactor ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' plugins ' => [
' clips ' ,
' fullscreen ' ,
],
' clips ' => [
[ ' Lorem ipsum... ' , ' Lorem... ' ],
[ ' red ' , ' <span class="label-red">red</span> ' ],
[ ' green ' , ' <span class="label-green">green</span> ' ],
[ ' blue ' , ' <span class="label-blue">blue</span> ' ],
],
],
]); use vova07 imperavi Widget ;
echo $ form -> field ( $ model , ' content ' )-> widget (Widget:: className (), [
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' plugins ' => [
' clips ' ,
' fullscreen ' ,
],
' clips ' => [
[ ' Lorem ipsum... ' , ' Lorem... ' ],
[ ' red ' , ' <span class="label-red">red</span> ' ],
[ ' green ' , ' <span class="label-green">green</span> ' ],
[ ' blue ' , ' <span class="label-blue">blue</span> ' ],
],
],
]); echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' plugins ' => [
' clips ' ,
' fullscreen ' ,
],
' clips ' => [
[ ' Lorem ipsum... ' , ' Lorem... ' ],
[ ' red ' , ' <span class="label-red">red</span> ' ],
[ ' green ' , ' <span class="label-green">green</span> ' ],
[ ' blue ' , ' <span class="label-blue">blue</span> ' ],
],
],
]); // DefaultController.php
public function actions ()
{
return [
' images-get ' => [
' class ' => ' vova07imperaviactionsGetImagesAction ' ,
' url ' => ' http://my-site.com/images/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' options ' => [ ' only ' => [ ' *.jpg ' , ' *.jpeg ' , ' *.png ' , ' *.gif ' , ' *.ico ' ]], // These options are by default.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' imageUpload ' => Url:: to ([ ' default/image-upload ' ]),
' imageManagerJson ' => Url:: to ([ ' /default/images-get ' ]),
' plugins ' => [
' imagemanager ' ,
],
],
]); // DefaultController.php
public function actions ()
{
return [
' files-get ' => [
' class ' => ' vova07imperaviactionsGetFilesAction ' ,
' url ' => ' http://my-site.com/files/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' options ' => [ ' only ' => [ ' *.txt ' , ' *.md ' ]], // These options are by default.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' fileUpload ' => Url:: to ([ ' default/file-upload ' ]),
' fileManagerJson ' => Url:: to ([ ' /default/files-get ' ]),
' plugins ' => [
' filemanager ' ,
],
],
]); // DefaultController.php
public function actions ()
{
return [
' image-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/images/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' imageUpload ' => Url:: to ([ ' /default/image-upload ' ]),
' plugins ' => [
' imagemanager ' ,
],
],
]); // DefaultController.php
public function actions ()
{
return [
' file-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/files/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' uploadOnlyImage ' => false , // For any kind of files uploading.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' fileUpload ' => Url:: to ([ ' /default/file-upload ' ]),
' plugins ' => [
' filemanager ' ,
],
],
]); // DefaultController.php
public function actions ()
{
return [
' file-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/files/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' uploadOnlyImage ' => false , // For any kind of files uploading.
' unique ' => false ,
' replace ' => true , // By default it throw an excepiton instead.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' fileUpload ' => Url:: to ([ ' /default/file-upload ' ]),
' plugins ' => [
' filemanager ' ,
],
],
]); // DefaultController.php
public function actions ()
{
return [
' file-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/files/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' uploadOnlyImage ' => false , // For any kind of files uploading.
' unique ' => false ,
' translit ' => true ,
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' fileUpload ' => Url:: to ([ ' /default/file-upload ' ]),
' plugins ' => [
' filemanager ' ,
],
]
]); echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' plugins ' => [
' clips ' ,
' fullscreen '
]
],
' plugins ' => [
' my-custom-plugin ' => ' appassetsMyPluginBundle ' ,
],
]); // DefaultController.php
public function actions ()
{
return [
' images-get ' => [
' class ' => ' vova07imperaviactionsGetImagesAction ' ,
' url ' => ' http://my-site.com/images/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
],
' image-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/images/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
],
' file-delete ' => [
' class ' => ' vova07imperaviactionsDeleteFileAction ' ,
' url ' => ' http://my-site.com/statics/ ' , // Directory URL address, where files are stored.
' path ' => ' /var/www/my-site.com/web/statics ' , // Or absolute path to directory where files are stored.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' imageUpload ' => Url:: to ([ ' /default/image-upload ' ]),
' imageDelete ' => Url:: to ([ ' /default/file-delete ' ]),
' imageManagerJson ' => Url:: to ([ ' /default/images-get ' ]),
],
' plugins ' => [
' imagemanager ' => ' vova07imperavibundlesImageManagerAsset ' ,
],
]); // DefaultController.php
public function actions ()
{
return [
' files-get ' => [
' class ' => ' vova07imperaviactionsGetFilesAction ' ,
' url ' => ' http://my-site.com/images/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
],
' file-upload ' => [
' class ' => ' vova07imperaviactionsUploadFileAction ' ,
' url ' => ' http://my-site.com/files/ ' , // Directory URL address, where files are stored.
' path ' => ' @alias/to/my/path ' , // Or absolute path to directory where files are stored.
' uploadOnlyImage ' => false , // For any kind of files uploading.
],
' file-delete ' => [
' class ' => ' vova07imperaviactionsDeleteFileAction ' ,
' url ' => ' http://my-site.com/statics/ ' , // Directory URL address, where files are stored.
' path ' => ' /var/www/my-site.com/web/statics ' , // Or absolute path to directory where files are stored.
],
];
}
// View.php
echo vova07 imperavi Widget:: widget ([
' selector ' => ' #my-textarea-id ' ,
' settings ' => [
' lang ' => ' ru ' ,
' minHeight ' => 200 ,
' fileUpload ' => Url:: to ([ ' /default/file-upload ' ]),
' fileDelete ' => Url:: to ([ ' /default/file-delete ' ]),
' fileManagerJson ' => Url:: to ([ ' /default/files-get ' ]),
],
' plugins ' => [
' filemanager ' => ' vova07imperavibundlesFileManagerAsset ' ,
],
]);$ phpunit请检查Imperavi Reclactor V10文档以获取有关其配置选项的更多信息。
请有关详细信息,请参阅贡献。
BSD许可证(BSD)。请参阅许可证文件以获取更多信息。
请检查升级指南以获取详细信息。