小编ada*_*amj的帖子

Composer/Laravel:如何添加/更新特定包

如何使用composer添加/更新特定包?我正在使用最新的Laravel,不确定它是否重要,但任何有助于确定答案的东西.

我也从我找到的旧Stackoverflow帖子中尝试了以下内容,但它对我不起作用.它将包附加到composer.json,然后继续更新所有内容.以下是链接:如何使用Composer更新单个库?

这是我试图添加到我的项目的包:https://github.com/barryvdh/laravel-dompdf

非常感谢您的时间和帮助!

编辑:


要求和更新不起作用他们也更新一切.我错误地运行命令有可能吗?在作曲家方面,我仍然是绿色的耳朵:S

$ composer require barryvdh/laravel-dompdf
lease provide a version constraint for the barryvdh/laravel-dompdf requirement: *
/composer.json has been updated
oading composer repositories with package information
pdating dependencies (including require-dev)
 - Removing orchestra/testbench (v2.1.1)
 - Removing symfony/security (v2.4.3)
 - Removing symfony/translation (v2.4.3)
 - Installing symfony/translation (v2.4.6)
   Loading from cache

 - Removing symfony/http-foundation (v2.4.3)
 - Installing symfony/http-foundation (v2.4.6)
   Loading from cache

 - Removing symfony/event-dispatcher (v2.4.3)
 - Installing symfony/event-dispatcher (v2.5.0)
   Loading from cache

 - …
Run Code Online (Sandbox Code Playgroud)

php laravel composer-php laravel-4

19
推荐指数
2
解决办法
4万
查看次数

如何加速svn外部?

我觉得这个问题的答案似乎很简单,但我似乎找不到任何东西,而且我还没有过多的SVN经验.

这是我用来制作它的propset命令:

svn propset svn:externals "wp-content http://example.com" .

我知道有一个,propedit但我不确定它是如何与svn externals一起使用的.是否可以编辑位置,让我们说http://example.com/branches/example

非常感谢您的任何建议.

svn

6
推荐指数
2
解决办法
7855
查看次数

jQuery - 在ajax调用之后恢复表单提交

是否可以阻止表单提交,然后在ajax调用成功中重新提交相同的表单?

目前它获得了成功,但它没有重新提交应该提交的表单并将用户重定向到http://example.com网站.

非常感谢您提前提供任何帮助

如果不可能这样做,还有另一种方法可以让它发挥作用吗?

$(document).ready(function() {
    $('form').submit(function(e) {
        e.preventDefault();

        $.ajax({
            url: $('form').attr('action'),
            type: 'post',
            data: $('form').serialize(),
            success: function(data) {
                if (data == 'true')
                {
                    $('form').attr('action', 'http://example.com');
                    $('form').unbind('submit').submit(); // mistake: changed $(this) to $('form') - Problem still persists though it does not resubmit and redirect to http://example.com
                }
                else
                {
                    alert('Your username/password are incorrect');
                }
            },
            error: function() {
                alert('There has been an error, please alert us immediately');
            }
        });
    });
});
Run Code Online (Sandbox Code Playgroud)

编辑:

Stackoverflow帖子签出以下代码:

我只是想我提到我也试过这个代码而没有用.

var …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

4
推荐指数
2
解决办法
3万
查看次数

椭圆形底部的矩形

是否可以创建一个与下面示例一样圆的扁平椭圆形?

在此处输入图片说明

我查看了几个关于如何使用来自以下来源的 CSS 创建椭圆本身的示例:

不幸的是,当你缩小它的高度时,椭圆只是不想保留圆形。这是我当前如何尝试实现与上图相同的视觉外观的代码:

HTML

<ul>
<li>
<a href="#">
<span class="text">Home</span>
<span class="oval"></span>
</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

CSS

a {
    position: relative;
    padding: 10px 30px 0px 30px;
    text-transform: uppercase;
    background-color: red; color: #fff;
}
.text {
    position: relative;
    z-index: 1;
}
.oval {
    position: absolute;
    bottom: -8px; left: 0;
    z-index: 0;
    display: block;
    width: 100%; height: 20px;
    border-radius: ~"20px/10px"; /* I'm using LESS and it requires ~"" to make it work */
    background-color: red;
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明


为了感谢这里的每一个人,也为了将来对任何人的帮助,这是我的最终代码:

HTML

<ul> …
Run Code Online (Sandbox Code Playgroud)

css css-shapes

4
推荐指数
1
解决办法
3200
查看次数

WordPress在自定义管理菜单下显示分类法

我正在尝试在仅一个页面的admin菜单项下显示自定义分类法,即http://example.com/wp-admin/admin.php?page=bla

根据WordPress开发人员的说法。register_taxonomyshow_in_menu下的页面显示以下内容:

“某些字符串”-如果现有的顶级页面(例如“ tools.php”或“ edit.php?post_type = page”),则该帖子类型将作为该页面的子菜单放置。

这是否意味着分类法不能显示在那些分类法之外?

的PHP

<?php
// hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'create_book_taxonomies', 0 );

// create two taxonomies, genres and writers for the post type "book"
function create_book_taxonomies() {
    // Add new taxonomy, make it hierarchical (like categories)
    $labels = array(
        'name'              => _x( 'Genres', 'taxonomy general name' ),
        'singular_name'     => _x( 'Genre', 'taxonomy singular name' ),
        'search_items'      => __( 'Search Genres' …
Run Code Online (Sandbox Code Playgroud)

php wordpress

4
推荐指数
1
解决办法
3167
查看次数

Kohana 3.3不在Subdirectory中工作

回答:

Kohana 3.3,他们没有考虑文件夹/文件的区分大小写(他们将一些目录/文件大写),所以当他们开始切换到新的Kohana时,这会让一些人感到疯狂(就像我一样).

我切换回Kohana 3.2,直到修复完毕.


非常感谢你花时间阅读我关于这个愚蠢问题的巨大帖子,我希望这个答案可以挽救未来可怜的灵魂生活=)

php mod-rewrite kohana kohana-3

2
推荐指数
1
解决办法
2394
查看次数

jQuery - bxSlider插件reloadSlider问题

我正在使用带有bxSlider插件的jQuery,这里只是链接到它:http://bxslider.com/

在我从中删除某些幻灯片后,我正在尝试重新加载滑块和我的自定义寻呼机.

这是我尝试过的:

$(function() {
    var slider = $('#slider').bxSlider({
        pagerCustom: '#bx-pager'
    });

    $('.list').on('click', '.delete', function() {
        image = $(this).closest('li').find('[type="hidden"]');

        // image.attr('id') contains a string: image-0, image-1, image-2, etc.
        $('#slider, #bx-pager').find('.' + image.attr('id')).remove(); 

        slider.reloadSlider({
            pagerCustom: '#bx-pager'
        }); // I have also tried: slider.reloadSlider();
    });
});
Run Code Online (Sandbox Code Playgroud)

它部分工作.会发生什么事情是滑块重新加载很好但它在运行重新加载时完全删除了分页器.

非常感谢您的帮助.

javascript jquery bxslider

2
推荐指数
1
解决办法
7401
查看次数

Laravel:按特定ID排序

我一直看起来很疯狂,但我似乎无法通过Laravel的Eloquent找到与此相似的方法:

select id,name 
from friends 
order by id=5 desc
Run Code Online (Sandbox Code Playgroud)

从以下链接获取的示例:mysql SQL:首先是特定项,然后对其余项进行排序

我希望一个简单的Group::orderBy('id', $id, 'DESC')->get()工作,但没有这样的运气.

我也考虑过使用,DBorderBy该类的方法采用完全相同的参数,并且没有特定ID的选项.还有其他选择吗?

非常感谢您的帮助!

php laravel laravel-4

2
推荐指数
1
解决办法
1880
查看次数

angularjs - 具有ng-model的名称数组

我正在学习棱镜,所以请和我一起露出来.

我有一个添加按钮,使用指令添加到表的(.estimates)tbody:

function EstimateCtrl( $scope, $compile ) {

    $scope.services = [
            { 'value': 'c', 'name': 'Standard Courier' },
            { 'value': 'xc', 'name': 'Express Courier' },
            { 'value': 'cc', 'name': 'Country Courier' }
    ]

    $scope.add = function() {

        angular.element('.estimates tbody').append( $compile('<tr estimate></tr>')($scope) );

    }

}

angular.module('dashboard', [])
    .directive('estimate', function() {

        return {

            restrict: 'A',
            template: '<td><input type="text" placeholder="Suburb"/></td><td><select ng-model="estimate.service" ng-options="service.value as service.name for service in services" class="form-control"></select></td><td>$0.00</td><td><button type="button" class="remove">x</button></td>',
            link: function( scope, element, attrs ) {

                element.find('.remove').bind('click', function() {

                    element.closest('tr').remove();

                }); …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs

1
推荐指数
1
解决办法
4万
查看次数

WordPress:如何为自定义插件中的文件创建重写规则

我一直在寻找几个小时试图找到一个直截了当的答案,但我似乎无法找到解决这个问题的任何东西.有许多重写标准URL的例子,但没有任何关于从自定义插件中重写页面的内容.

我已经创建了一个自定义插件,其中包含一个名为的特殊目录test.测试目录有几个blah.phpshmeh.php.是否有可能创建重写规则,这些页面即http://example.com/blah,http://example.com/shmeh

非常感谢你的帮助.

php wordpress wordpress-plugin

1
推荐指数
1
解决办法
2259
查看次数

CSS更新:检查输入后

请注意,HTML无法修改.

HTML:

<div class="form-group newsletter">
    <div class="checkbox">
        <label><input name="newsletter" type="checkbox" value="Sign me up for exclusive discounts and style advice by email, post and text" aria-invalid="false">Sign me up for exclusive discounts and style advice by email, post and text</label>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

上海社会科学院:

.form-group {
    input {
        opacity: 0;
    }
    label {
        &:after {
            float: left;
            display: block;
                content: "";
            width: 52px; height: 52px;
                margin-right: 35px;
            background: url('../img/checkbox-default.png') no-repeat;
        }
        input:checked ~ &:after { // This. Not sure how to make this …
Run Code Online (Sandbox Code Playgroud)

html css sass

1
推荐指数
1
解决办法
2414
查看次数

jQuery - on('click')append似乎不起作用

http://jsfiddle.net/D6be5/

HTML

<table class="example" border="1">
    <tr>
        <td>
            <label>Enter text</label>
            <textarea>Enter text</textarea>
        </td>
    </tr>
    <tr class="clone"></tr>
</table>

<p><button id="add-row">Add Row</button></p>?
Run Code Online (Sandbox Code Playgroud)

jQuery的

$(document).ready(function() {
    $(this).on('click', function(event) {
        if ( ! $(event.target).closest('table').hasClass('example')) {
            $('table label').show();
            $('table textarea').hide();
        }
    });

    $('table td').on('click', function() {
        $('table label').show();
        $('table textarea').hide();
        $(this).find('label').hide();
        $(this).find('textarea').show();
    });

    $('#add-row').on('click', function() {
        _this = $('table tr.clone')
            .clone()
            .removeClass('clone')
            .insertBefore('.clone');

        _this.append('<td><label>Enter text</label><textarea>Enter text</textarea></td>');
    });                
});?
Run Code Online (Sandbox Code Playgroud)

CSS

table textarea {
    display: none;
}

table .clone {
    display: none;
}?
Run Code Online (Sandbox Code Playgroud)

上面的链接解释了我正在尝试做什么.

基本上问题是这个.我在td中有一个标签 …

javascript jquery

0
推荐指数
1
解决办法
1147
查看次数

Laravel5使用params重定向到外部URL

我已经浏览了以下页面,但我找不到任何示例:http://laravel.com/docs/5.1/responses#redirects.

我尝试过以下方法:

return redirect()->away('http://bla.com');

这有效,但只要您添加params,就会收到以下错误消息

PHP:

return redirect()->away('http://bla.com', ['bla' => 'bla']);

错误:

InvalidArgumentException in Response.php line 470: The HTTP status code "1" is not valid.

php laravel-4 laravel-5

0
推荐指数
1
解决办法
2464
查看次数