YiiWheels
  • Package
  • Class
  • Tree

Packages

  • None
  • yiiwheels
    • behaviors
    • widgets
    • widgets
      • ace
      • box
      • datepicker
      • daterangepicker
      • datetimepicker
      • detail
      • fileupload
      • fileuploader
      • gallery
      • google
      • grid
        • behaviors
        • operations
      • highcharts
      • maskInput
      • maskmoney
      • modal
      • multiselect
      • rangeslider
      • redactor
      • select2
      • sparklines
      • switch
      • timeago
      • timepicker
      • toggle
      • typeahead

Classes

  • WhModal
 1 <?php
 2 /**
 3  * WhModal class file.
 4  *
 5  * Bootstrap modal + modal manager wrapper in order to use the modalmanager and easy the task of rendering a modal
 6  * template.
 7  *
 8  * @see http://jschr.github.com/bootstrap-modal/
 9  * @author Antonio Ramirez <amigo.cobos@gmail.com>
10  * @copyright Copyright &copy; 2amigos.us 2013-
11  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
12  * @package YiiWheels.widgets.modal
13  */
14 
15 class WhModal extends TbModal
16 {
17 
18     /**
19      * Widget's initialization
20      */
21     public function init()
22     {
23         parent::init();
24         $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));
25     }
26 
27     /**
28      * Widget's run method
29      */
30     public function run()
31     {
32         parent::run();
33 
34         $this->registerPluginFiles();
35     }
36 
37     /**
38      * Registers required plugins files (js|img|css)
39      */
40     public function registerPluginFiles()
41     {
42         /* publish assets dir */
43         $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
44 
45         $assetsUrl = $this->getAssetsUrl($path);
46 
47         /* @var $cs CClientScript */
48         $cs = Yii::app()->getClientScript();
49 
50         $cs->registerCssFile($assetsUrl . '/css/bootstrap-modal.css');
51         $cs->registerScriptFile($assetsUrl . '/js/bootstrap-modal.js', CClientScript::POS_END);
52         $cs->registerScriptFile($assetsUrl . '/js/bootstrap-modalmanager.js', CClientScript::POS_END);
53     }
54 
55 }
YiiWheels API documentation generated by ApiGen 2.8.0