小编Fun*_*end的帖子

如何翻译Laravel的路线?

基于这个问题,我试图用英语和西班牙语翻译Laravel 4.2中的路线.

这是我的app/routes.php代码:

<?php


/*Set up locale and locale_prefix if other language is selected*/
if (in_array(Request::segment(1), Config::get('app.web_config.alt_langs'))) {

    App::setLocale(Request::segment(1));
    Config::set('app.web_config.locale_prefix', Request::segment(1));
}


foreach(Lang::get('routes') as $k => $v) {
    Route::pattern($k, $v);
}

Route::group(array('prefix' => Config::get('app.web_config.locale_prefix')), function()
{
    Route::get('/{revelar_fotos}/',['as' => 'revelado_online', 'uses' => 'WebController@reveladoOnline'], function(){
        return 'pages.revelado_online'.App::getLocale();
    });

});
Run Code Online (Sandbox Code Playgroud)

通过点击链接,我在网址中收到此错误:

http://mywebsite.dev/%7Brevelar_fotos%7D
Run Code Online (Sandbox Code Playgroud)

代替:

http://mywebsite.dev/photograph-development

这是我的en/routes.php:

<?php

return array(

    'revelar_fotos' => 'photograph-development',
);
Run Code Online (Sandbox Code Playgroud)

这是我的es/routes.php:

<?php

return array(

    'revelar_fotos' => 'revelado-online',
);
Run Code Online (Sandbox Code Playgroud)

为什么我返回此错误?

php multilingual routes laravel-4

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

Laravel 重定向-&gt;back() 返回空参数

我有一个index.blade.php页面,我有一个显示警报成功或错误的代码:

\n\n
    <!-- ALERTS -->\n    @if (isset($msg))\n        @if ($msg_type == \'error\')\n            <div id="alert" class="alert alert-danger" role="alert">{{ $msg }}</div>\n        @else\n            <div id="alert" class="alert alert-success" role="alert">{{ $msg }}</div>\n        @endif\n        <script>setTimeout("document.getElementById(\'mensajecarrito\').style.display=\'none\'",6000);</script>\n    @endif\n    <!-- //ALERTS -->\n
Run Code Online (Sandbox Code Playgroud)\n\n

这个索引有一个表单,这个表单的url POST到post_designs url,这是他的控制器方法:

\n\n
public function postDesign() {\n\n        if (Session::has(\'FUNCTION\'))\n                $function = Session::get(\'FUNCTION\');\n\n            if (Input::has(\'FUNCTION\'))\n                $function = Input::get(\'FUNCTION\'); \n\n            if (isset($function))\n            {           \n                switch($function)\n                {\n                    case \'createDesign\':   \n\n                        try\n                        {   \n                            //do something good\n                            $msg_type = \'success\';                      \n                            $msg = \'Design created successfully\';     \n                        }\n …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5

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

安装mac osx后安装nginx模块

我使用以下命令安装 nginx: brew install nginx

在我的 nginx.conf 文件中使用模块 set_real_ip_from 后:

ginx: [emerg] unknown directive "set_real_ip_froxm" in /usr/local/etc/nginx/nginx.conf:26
Run Code Online (Sandbox Code Playgroud)

我需要安装模块http_realip_module

但我不知道,我试试这个

brew reinstall nginx --with-http_realip_module
Run Code Online (Sandbox Code Playgroud)

但不起作用...

如何安装 nginx 模块?

macos homebrew nginx

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

CSS 轮廓属性圆角

我添加了此元素并添加了此样式:

.checkout-step.current .number {
  background-color: #d26d51;
  outline: 1px solid #d26d51;
  outline-offset: 4px;
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

但我不想在轮廓中使用方角,我想要圆角,就像这个例子: 在此输入图像描述

我怎样才能做到这一点?

html css outline

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

为什么我的 svg 看起来如此糟糕?

我的 svg 在 Google Chrome 和 Firefox 中看起来也很糟糕,Svg 边框质量很差:

在此处输入图片说明

同时,在 Illustrator 中,svg 看起来很棒:

在此处输入图片说明

我已经用这个配置保存了 .svg 文件:

在此处输入图片说明

发生了什么?

svg google-chrome adobe-illustrator

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

在这个HTML代码中,"styles.css?= 121"是什么意思?

我查看了一些以这种方式放置样式表的html代码:

<link href="styles.css?=121" rel="stylesheet" type="text/css">
Run Code Online (Sandbox Code Playgroud)

这是什么意思?

css

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

语法错误,无法识别的表达式:!在jQuery选择器中检查

我在一个带有jquery 1.7的网站上使用这个脚本.

$('input:radio[name=article-info]:!checked').parent().parent().removeClass('highlight')
Run Code Online (Sandbox Code Playgroud)

我在引导程序模板中移动此脚本,但chrome控制台报告我此错误:

未捕获错误:语法错误,无法识别的表达式:input:radio [name = article-info]:!已选中

Bootstrap使用jQuery的更新版本.

我应该使用此版本的语法?

完整的代码:

// Select input radio button
        $('input[type=radio][name=article-info]').change(function() {

               $('input:radio[name=article-info]:not(:checked)').parent().parent().removeClass('highlight');
               $(this).parent().parent().addClass('highlight');

               // Price
               $price = $('label[for="'+ $(this).attr('id') +'"] .tr-price').text();
               $('#price-total').text($price);

               // Url btn
               $new_url = $(this).parent().siblings('.format').children().children('input').val();
               $('#btn-personalizar').attr("href", $new_url);
         });
//Select tr
        $(".data-click-tr").click(function(){


               $(".data-click-tr").removeClass('highlight')
               $(this).addClass('highlight').find('input:radio[name=article-info]').attr('checked', true);

               $get_input_id = $(this).find('input:radio[name=article-info]').val();

               // Precio
               $price = $('label[for="'+ $get_input_id +'"] .tr-price').text();
               $('#price-total').text($price);

               // Url btn personalizar
               $new_url = $(this).find('.format').children().children('input').val();
               $('#btn-personalizar').attr("href", $new_url);
         });
Run Code Online (Sandbox Code Playgroud)

HTML:

<table id="select-size">
    <thead class="size-and-price">
        <tr class="header-table">
            <th colspan="2">Tamaño</th>
            <th class="">Precio</th>
        </tr>
    </thead>
    <tbody> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

谷歌镀铬块弹出Facebook登录

我在我的laravel php应用程序中启动了一个FB.login(),但Chrome会阻止弹出窗口:

<script>
    window.fbAsyncInit = function() {
        FB.init({
          appId      : '{{config('services.facebook.client_id')}}',
          xfbml      : true,
          version    : 'v2.5'
        });
     };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

    function facebookLogin(e){

        isLoggedIntoFacebook(function(isLoggedIn) {
            if (isLoggedIn) {
                window.location.href = '{{ route('social.redirect', ['provider' => 'facebook']) }}'
            } else {
                FB.login(function(response) {
                    loginUserIntoRegalosPersonales();
                }, { scope: ['email', 'user_birthday'] });

                FB.Event.subscribe('auth.login', function () {
                 window.location.href = '{{ route('social.redirect', ['provider' …
Run Code Online (Sandbox Code Playgroud)

javascript php facebook google-chrome facebook-javascript-sdk

-3
推荐指数
1
解决办法
4271
查看次数

FatalErrorException语法错误,意外','

我找不到语法错误,谢谢你:

return '<?php echo \FuWidget::getDesignsList('.$article_id.', unserialize("'.serialize($params).'")); ?>';
Run Code Online (Sandbox Code Playgroud)

php laravel

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