小编toe*_*lab的帖子

PHP setlocale没有任何效果

setlocale()功能未设置所需的语言(德语).


目标是输出月份名称.

到目前为止,这是我的测试代码:

<?php

date_default_timezone_set('Europe/Berlin');
setlocale(LC_ALL, 'de_DE.utf8');
// Or
setlocale(LC_ALL, 'de_DE@euro');
// Or
setlocale(LC_ALL, 'de_DE');
// Or
setlocale(LC_ALL, 'de');
// Or
setlocale(LC_ALL, 'ge');


echo strftime('%B');
Run Code Online (Sandbox Code Playgroud)

输出:

六月

代替

六月

有什么建议?

  • 我没有ssh或其他shell访问权限.
  • 该脚本在linux服务器上运行.

PHP 5.6版

php date setlocale

64
推荐指数
10
解决办法
7万
查看次数

带有'min_amount'和'set_customer_limit'的PayPal按钮

我创建了一个带有文本输入的非托管 PayPal按钮,以便用户定义要支付的金额.这是一个订阅按钮.

现在的问题是必须有最低支付金额,比如101(瑞士法郎 - 瑞士法郎).

根据PayPal HTML-Variables的文档,我可以在隐藏的输入中添加以下变量到我的表单,以使其工作.

  • set_customer_limit 价值为 max_limit_own
  • min_amount 价值为 101

set_customer_limit是工作但不是min_amount.任何金额都被接受.

我在技术支持处开了一张票,但到目前为止还没有回复.

这是我的表格:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <!-- //... -->
    <input type="hidden" name="cancel_return" value="mydomain.com/cancel">
    <input type="hidden" name="return" value="mydomain.com/paid">
    <input type="hidden" name="token" value="<?php echo $token; ?>">
    <input type="hidden" name="src" value="1">
    <input type="text" name="a3" value="101.00">
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="Y">
    <input type="hidden" name="currency_code" value="CHF">
    <input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest">
<!-- the concerned inputs -->
    <input …
Run Code Online (Sandbox Code Playgroud)

php paypal

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

获取整个语言文件数组

我是laravel 4.0的新手.

  • 如何获得整个阵列lang/en/texts.php
  • Lang::getAll()方法吗?

我的目标是在我的基本控制器中生成关键字/描述,将它们填充到主刀片模板中的元标记和DOM中的其他位置.如果我的方法完全错误,请告诉我!

从关联数组生成关键字和描述不是问题,而是缺乏关于框架的知识.而且,我在谷歌搜索了很长一段时间才结束了...

使用刀片模板:这是我的BaseController:

class HomeController extends BaseController {

    protected $layout = 'layouts.master';
    private $keyWords = array();

    private function getKeyWords () {
        // ???

    }

    public function getIndex() {
        return View::make('home')
            ->with('errorcanvas', trans('texts.canvas'))
            ->with('errortextwebgl', trans('texts.webgl'))
            ...;
    }

    ...

}
Run Code Online (Sandbox Code Playgroud)

我在API中找到了一些东西:

Illuminate\Translation\FileLoader load()用给定的locale ... 加载消息

php laravel laravel-4

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

Response内容必须是实现__toString(),\"boolean \"的字符串或对象."

我正在尝试使用渲染的View返回Response::json但是我收到此错误:

The Response content must be a string or object implementing __toString(), \"boolean\" given."
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

$posts = Post::where( ... )->orderBy( ... )->get();
$data['posts'] = View::make("posts.partials.loadHome")->with("posts", $posts)->render();
$data['msg'] = "ok";

return Response::json($data);
Run Code Online (Sandbox Code Playgroud)

如果var_dump($data)我得到这个:

<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=2)</i>
  'posts' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'&lt;div class=&quot;post postGrid&quot; data-id=&quot;1864&quot;&gt;&#10; &lt;a target=&#39;_blank&#39; href=&quot;http://objavi.net/posts/1864&quot;&gt;&lt;img src=&quot;http://objavi.net/&quot; id=&quot;imgWrap&quot; data-original=&quot;/thumbs/YAo4wFzIpl76.jpg&quot; class=&quot;lazy&quot; alt=&quot;Deset manje poznatih ?injenica o Jozefu Staljinu&quot;&gt;&lt;/a&gt;&#10;  &#10;   &lt;div id=&quot;bodyPreview&quot;&gt;&#10;     &#10;       &lt;a target=&#39;_blank&#39; href=&quot;http://objavi.net/posts/1864&quot;&gt;&lt;h1 class=&quot;previewTitle&quot;&gt;Deset manje poznatih ?injenica o Jozefu Staljinu&lt;/h1&gt;&lt;/a&gt;&#10;&#10;     &lt;h3 id=&quot;postInfo&quot;&gt;&#10; …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-4

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

使用便携式打印机通过蓝牙与Delphi XE7连接

我正在尝试通过蓝牙与Sewoo LK-P32打印机通信.为此,我使用的是Delphi XE7.我做了一些Delphi附带的例子并没有成功.我把配对的打印机放在平板电脑中,即使这样我也无法连续打印.

当我打印的东西必须重新启动应用程序,所以我可以再打印一些东西.在我的来源下面.

有人能帮助我吗?支持这个问题?我尝试其他技术的时间很短.

启动与打印机通信的方法

procedure TForm2.ButtonClickStart(Sender: TObject);
var
  Msg, Texto: string;
  I, B: Integer;
  BluetoothAdapter: TBluetoothAdapter;
  ListaDeAparelhosPareados: TBluetoothDeviceList;
  LServices: TBluetoothServiceList;
begin
  try
    Memo1.Lines.Add('Ponto 1');
    FBluetoothManager := TBluetoothManager.Current;
    if FBluetoothManager = nil then
      Memo1.Lines.Add('FBluetoothManager esta nulo');

    Memo1.Lines.Add('Ponto 2');
    BluetoothAdapter := FBluetoothManager.CurrentAdapter;
    if BluetoothAdapter = nil then
    Memo1.Lines.Add('BluetoothAdapter esta nulo');

    ListaDeAparelhosPareados := BluetoothAdapter.PairedDevices;
    Memo1.Lines.Add('Ponto 3');
    if ListaDeAparelhosPareados = nil then
      Memo1.Lines.Add('ListaDeAparelhosPareados esta nulo');

    for I := 0 to ListaDeAparelhosPareados.Count - 1 do
    begin
      LDevice := ListaDeAparelhosPareados[I] …
Run Code Online (Sandbox Code Playgroud)

delphi bluetooth firemonkey delphi-xe7

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

刀片视图:if语句带有OR/AND条件

是否可以在Laravel 4.0 -blade-view中执行if语句?

@if ($var1 === '1' OR $var2 === '1')
    //Do my stuff
@endif
Run Code Online (Sandbox Code Playgroud)

要么

@if ($var1 === '1' || $var2 === '1')
    //Do my stuff
@endif
Run Code Online (Sandbox Code Playgroud)

或者不管它是什么语法.我没有在L4文档中找到任何内容,它是否存在?

php if-statement view blade laravel-4

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

Doctrine ORM:删除所有表而不删除数据库

我必须使用现有数据库(不使用Doctrine管理),我只想将doctrine用于此数据库中的新表.

有没有办法告诉Doctrine不要在重新加载时删除整个数据库,而只是在yaml文件中定义的模型?

orm doctrine

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

ListFragment支持库GetSupportFragmentManager未定义

我有一个列表片段(导入v4支持库,构建目标是2.3.3 api 11)和我的代码中的以下问题,当目标是3.0并且我没有使用该库时工作正常.

Fragment frag1 = new ExampleFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.contentframe, frag1);
ft.commit();
Run Code Online (Sandbox Code Playgroud)

现在我收到了编译错误

"Type mismatch: cannot convert from ExampleFragment to Fragment"
Run Code Online (Sandbox Code Playgroud)

它告诉我将"Fragment"更改为ExampleFragment(例如)

ExamplesFragment frag1 = new ExamplesFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.contentframe, frag1);
ft.commit();
Run Code Online (Sandbox Code Playgroud)

然后我遇到ft.replace命令有错误的问题:

The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, Fragment_PVAnn)
Run Code Online (Sandbox Code Playgroud)

它告诉我将第一行中的ExamplesFragment更改回Fragment,这样圆圈四处转动

java android android-fragments

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

如何将click事件绑定到object标签?

我有这个代码

<object data="images/logo.svg" type="image/svg+xml" class="icon-logo"></object>
Run Code Online (Sandbox Code Playgroud)

和jquery

$(".icon-logo").click(function() {
.....
});
Run Code Online (Sandbox Code Playgroud)

但我无法点击事件.

html javascript jquery

8
推荐指数
2
解决办法
8901
查看次数

jQuery tablesorter:如何使用类而不是"内联JSON"禁用列上的排序?

我正在使用jQuery tablesorter插件.我知道如何使用jQuery Metadata插件禁用对列的排序:

<th class="{sorter: false}">Don't sort me</th>
Run Code Online (Sandbox Code Playgroud)

但我宁愿通过设置一个类来做到这一点,所以我不必使用额外的插件.另外我想我会比记住这个JSON语法更容易记住类名.如何使用以下语法执行相同的操作:

<th class="not-sortable">Don't sort me</th>
Run Code Online (Sandbox Code Playgroud)

javascript jquery tablesorter jquery-plugins

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