मैं:
इसके अलावा Errors & Logging docs
संपादित
पर एक नज़र डालें जब आप उस दृश्य को डेटा पास करने के लिए की जरूरत है, दूसरा पैरामीटर एक सरणी का उपयोग कर सकते है यह आपके app/start/global.php
में डालने की सलाह देगा क्योंकि वह जगह है जहां लार्वा इसे डिफ़ॉल्ट रूप से संभालती है (हालांकि filters.php
भी काम करेगा)। मैं आमतौर पर कुछ इस तरह का उपयोग करें:
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function(Exception $exception, $code)
{
$pathInfo = Request::getPathInfo();
$message = $exception->getMessage() ?: 'Exception';
Log::error("$code - $message @ $pathInfo\r\n$exception");
if (Config::get('app.debug')) {
return;
}
switch ($code)
{
case 403:
return Response::view('errors/403', array(), 403);
case 500:
return Response::view('errors/500', array(), 500);
default:
return Response::view('errors/404', array(), $code);
}
});
तो बस /views
के अंदर एक errors
फ़ोल्डर बनाने और वहाँ अपने त्रुटि पृष्ठ की सामग्री जगह। जैसा कि एंटोनियो ने बताया है कि आप array()
के अंदर डेटा पास कर सकते हैं।
मैं पेशे से https://github.com/andrewelkins/Laravel-4-Bootstrap-Starter-Site
स्रोत
2014-09-02 18:31:44
के लिए निर्दिष्ट कोई रूट नहीं है, तो यह दृश्य प्रस्तुत करेगा: मैं अनुरोध: url() को मिस्ड ब्लेड के लिए कैसे पास कर सकता हूं। – alayli
आपके प्रश्न का उत्तर देने के लिए संपादित किया गया। –
हैलो ... 404 पृष्ठ में "पिछले पृष्ठ पर जाएं" जैसे लिंक जोड़ने के लिए पिछला यूआरएल प्राप्त करना संभव है? – SoldierCorp