Laravel附带此验证消息,显示以千字节为单位的文件大小:
file' => 'The :attribute may not be greater than :max kilobytes.',
Run Code Online (Sandbox Code Playgroud)
我想以一种显示兆字节而不是千字节的方式自定义它.所以对于用户来说,它看起来像:
"该文件可能不会超过10兆字节."
我怎样才能做到这一点?
我有一些西里尔文数据,我想使用 Codeigniter 将其导出到 .csv 文件中。问题是 csv_from_result() 方法混淆了这些字符。
\n\n$this->load->dbutil();\n$delimiter = ",";\n$newline = "\\r\\n";\n\n$report_result = $this->data_model->get_data_result();\n$data[\'csv\'] = $this->dbutil->csv_from_result($report_result, $delimiter, $newline);\nRun Code Online (Sandbox Code Playgroud)\n\n在我看来,我有:
\n\n<?php\nheader("Content-type: application/csv-tab-delimited-table; charset=utf-8" );\nheader("Content-Disposition: attachment; filename=csvdata.csv" );\nheader("Content-Transfer-Encoding: binary" );\n echo $csv; \n?> \nRun Code Online (Sandbox Code Playgroud)\n\n输出文件包含如下混乱的字符:
\n\n\xc3\x90\xc2\xa2\xc3\x90\xc2\xb5\xc3\x91\xc3\x91\xe2\x80\x9a \xc3\x90\xc2\xbf\xc3\x90\xc2\xb8\xc3\x91\xc3\x90\xc2\xbc\xc3\x90\xc2\xbe","54","\xc3\x90 \xc3\x90\xc2\xb5\xc3\x91\xe2\x80\x9e\xc3\x90\xc2\xb5\xc3\x91\xe2\x82\xac\xc3\x90\xc2\xb5\xc3\x90\xc2\xbd\xc3\x91\xe2\x80\xa0\nRun Code Online (Sandbox Code Playgroud)\n 我在共享的Hostgator服务器上部署了一个Laravel 4应用程序.
当我导航到:
http://mydomain.com/laravel/public/
Run Code Online (Sandbox Code Playgroud)
我可以看到Laravel闪屏.
但是当我尝试访问任何其他途径时,比如,/ users或/ posts我得到了
Internal Server Error 500
http://mydomain.com/laravel/public/posts
Run Code Online (Sandbox Code Playgroud)
控制器:
public function index()
{
$posts = $this->post->all();
return View::make('posts.index', compact('posts'));
}
Run Code Online (Sandbox Code Playgroud)
在Routes.php中:
Route::resource('posts', 'PostsController');
Run Code Online (Sandbox Code Playgroud)
我使用Jeffrey Way的Generator来支撑帖子实体.
这在我的本地机器上工作正常.控制器不包含任何逻辑,它们只输出获取的数据.
错误日志为空.
任何想法要检查什么?.htaccess,也许?这是我在那里:
AddType application/x-httpd-php53 .php
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)