Fancy Box in yii2

hi all,

   I tried to develop fancy box using guideline of "" but whene i write "php composer.phar require --prefer-dist newerton/yii2-fancybox "dev-master" command on comand prompt then give error of installation failed.

   so I need to Know that "How To create Fancy Box in yii2" and why this command not work. 


   Please give me propar answer as soon as possible 

thanks in advance

Hi Jalpa,

Do you have composer installed and internet running with no blockings?

Post full error here!

Demanding answer like you have done below while you pay us no penny is both offensive and disrepectful that will only serve as reason why your post should not be answered!


I am Use this code for terminal "php composer.phar require --prefer-dist newerton/yii2-fancybox "dev-master" and than gave me error is  "Installation Failed" so i can not install composer

Hello …

I install yii2-fancybox without composer because I’m behind a proxy and composer still give me some problems to connect…

I’m using the yii2-advanced and this is what i did…

1- download the yii2-fancybox and put in to


2- add into vendor/bower/fancybox the file FancyBoxAsset.php

3- download the fancybox source code from and put content of the the source folder into


4- add this code to the common/config/main.php



'newerton/fancybox' => [









and that’s how far i get…

If you don’t use the lasted version of fancybox source code you will have some bugs like:

1- $.browser is undefined from source/jquery.fancybox.js

2- F.helpers is undefined from source/helpers/jquery.fancybox-buttons.js

3- F.helpers is undefined from source/helpers/jquery.fancybox-media.js

4- F.helpers is undefined from source/helpers/jquery.fancybox-thumbs.js

5- JQuery(…).fancybox is not a function…

all this bugs are from the code files of the fancybox plugin.


1 - down load yii2-fancybox put at vendor/newerton/yii2-fancybox-master

2 - down source code fancybox put at bower/fancybox/

3 - rename jquery.mousewheel-3.0.6.pack in folder bower/fancybox/lib to jquery.mousewheel

4 - open file vendor/newerton/yii2-fancybox-master/MousewheelAsset.php edit

public $sourcePath = '@bower/fancybox/lib';

5 - open file autoload_psr4.php at vendor/composer/ add

‘newerton\\fancybox\\’ => array($vendorDir . ‘/newerton/yii2-fancybox-master’),