duai4379
2015-12-10 09:28
浏览 82

如何在YII2中安装Jquery UI?

I work on YII project (advanced) and want to use JUI Extension for Yii 2 I've put "yiisoft/yii2-jui": "~2.0.0" line to my composer.json file and run composer install. After that I've tried to use widget:

<?php

use yii\jui\Sortable;

/* @var $this yii\web\View */
/* @var $searchModel common\models\SearchSomeModel */
/* @var $dataProvider yii\data\ActiveDataProvider */

echo Sortable::widget([
    'items' => [
        'Item 1',
        ['content' => 'Item2'],
        [
            'content' => 'Item3',
            'options' => ['tag' => 'li'],
        ],
    ],
    'options' => ['tag' => 'ul'],
    'itemOptions' => ['tag' => 'li'],
    'clientOptions' => ['cursor' => 'move'],
]); ?>

But there was an error:

The file or directory to be published does not exist: /path/advanced/vendor/bower/jquery-ui

Then I've read a recomendation on github to remove composer.lock and /vendor folder and made composer install again.

After that any page of my app gives error:

The file or directory to be published does not exist: /path/advanced/vendor/bower/jquery/dist

What am I doing wrong?

enter link description here

图片转代码服务由CSDN问答提供 功能建议

我在YII项目(高级)上工作,想要使用 Yii 2的JUI扩展 我已将”yiisoft / yii2-jui“:”~2.0.0“行添加到 我的composer.json文件并运行 composer install 。 之​​后我尝试使用widget:

 &lt;?php 
 
use  yii \ jui \ Sortable; 
 
 / * @var $ this yii \ web \ View * / 
 / * @var $ searchModel common \ models \ SearchSomeModel * / 
 / * @var $ dataProvider yii \ data \  ActiveDataProvider * / 
 
echo Sortable :: widget([
'items'=&gt; [
'Item 1',
 ['content'=&gt;'Item2'],
 [
'内容 '=&gt;'Item3',
'选项'=&gt; ['tag'=&gt;'li'],
 
,
 
,
'选项'=&gt; ['tag'=&gt;  ;'ul'],
'itemOptions'=&gt; ['tag'=&gt;'li'],
'clientOptions'=&gt; ['cursor'=&gt;'move'],
])  ;  ?&gt; 
   
 
 

但是出现了错误:

要转到的文件或目录 发布不存在:/ path / advanced / vendor / bower / jquery-ui

然后我在github上阅读推荐文件以删除 composer.lock和/ vendor文件夹并再次进行 composer install

之后我的应用程序的任何页面都出错: < blockquote>

要发布的文件或目录不存在:/ path / advanced / vendor / bower / jquery / dist n

我做错了什么?

在此输入链接说明

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dougong2306 2015-12-11 12:53
    已采纳

    It seems you have outdated fxp plugin.

    Run:

    composer self-update
    composer global require "fxp/composer-asset-plugin:~1.2.0"
    cd /path/to/advanced/application
    composer update
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题