定制 cenotia/yii2-remote-modal 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cenotia/yii2-remote-modal

最新稳定版本:v1.0.3

Composer 安装命令:

composer require cenotia/yii2-remote-modal

包简介

Yii2 Remote Modal

README 文档

README

#Yii2 Remote Modal by cenotia

This extension enables the use of several types of modals in a simplify way and using ajax.

In order to add it to your project you have to download the archive or use the composer tool which is the preferred way.

In your composer.json file add the following line :

"cenotia/yii2-remote-modal":"*"

and run composer update

###In Controller

in your controller's actions (that you want to display in a modal), add the following code :

public function actionTest() 
{
    $request = \Yii::$app->request;
    \Yii::$app->response->format = Response::FORMAT_JSON;
    return [
	    'title'=> "Test Titre",
	    'content'=>"Test content", // for example: $this->renderAjax('view', [
		    	                   //     'model' => $model,
			                       //  ]),
	    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
	    Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])
    ];
}

In your view

At the beginning of your file

use cenotia\components\modal\RemoteModal;

The calling link would be

<a href="/site/test" role="XXXXXXXXXID">Test</a>

At the end of the view file, add this :

<?php RemoteModal::begin([
	"id"=>"XXXXXXXXXID",
	"options"=> [ "class"=>"fade slide-right "],
	"footer"=>"", // always need it for jquery plugin
	])?>
<?php RemoteModal::end(); ?>

The available classes in options are :

  • slide-right
  • stick-up
  • fill-in
  • slide-up

统计信息

  • 总下载量: 11.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 4
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD
  • 更新时间: 2016-10-19