Learn the terrain.
+Learn the terrain.
You've landed yourself on our default home page. The route that @@ -34,13 +31,22 @@
{{ path('app') }}views/home/index.php-
Read the docs.
+Grow in knowledge.
- The docs are now included with the source package, you can {{ HTML::link('docs', 'read them offline here') }}. + Leaning to use Laravel is amazingly simple thanks to + its {{ HTML::link('docs', 'wonderful documentation') }}. + Here are the basics:
-Create something beautiful.
+-
+
- {{ HTML::link('docs/routing#the-basics', 'Defining Routes') }} +
- {{ HTML::link('docs/controllers#the-basics', 'Building Controllers') }} +
- {{ HTML::link('docs/views#the-basics', 'Creating Views') }} +
- {{ HTML::link('docs/database/eloquent', 'Eloquent ORM') }} +
Create something beautiful.
Now that you're up and running, it's time to start creating! diff --git a/bundles/docs/routes.php b/bundles/docs/routes.php index 43641286..184656cc 100644 --- a/bundles/docs/routes.php +++ b/bundles/docs/routes.php @@ -1,38 +1,75 @@ add('prettify', 'laravel/js/prettify.js'); - $view->with('sidebar', Markdown(file_get_contents(path('storage').'documentation/contents.md'))); + $view->with('sidebar', document('contents')); }); +/** + * Handle the documentation homepage. + * + * This page contains the "introduction" to Laravel. + */ Route::get('(:bundle)', function() { - return View::make('docs::home'); + return View::make('docs::page')->with('content', document('home')); }); -Route::get('docs/(:any)/(:any?)', function($section, $page = null) +/** + * Handle documentation routes for sections and pages. + * + * @param string $section + * @param string $page + * @return mixed + */ +Route::get('(:bundle)/(:any)/(:any?)', function($section, $page = null) { - $root = path('storage').'documentation/'; + $file = rtrim(implode('/', func_get_args()), '/'); - $file = rtrim(implode('/', array($section, $page)), '/').'.md'; - - if (file_exists($path = $root.$file)) + // If no page was specified, but a "home" page exists for the section, + // we'll set the file to the home page so that the proper page is + // display back out to the client for the requested doc page. + if (is_null($page) and document_exists($file.'/home')) { - $content = Markdown(file_get_contents($path)); + $file .= '/home'; } - elseif (file_exists($path = $root.$section.'/home.md')) + + if (document_exists($file)) { - $content = Markdown(file_get_contents($path)); + return View::make('docs::page')->with('content', document($file)); } else { return Response::error('404'); } - - return View::make('docs::page')->with('content', $content); }); \ No newline at end of file diff --git a/bundles/docs/views/home.blade.php b/bundles/docs/views/home.blade.php deleted file mode 100644 index 86670159..00000000 --- a/bundles/docs/views/home.blade.php +++ /dev/null @@ -1,37 +0,0 @@ -@layout('docs::template') - -@section('content') -
Learn the terrain.
- -- You've landed yourself on our default home page. The route that - is generating this page lives in the main routes file. You can - find it here: -
- -APP_PATH/routes.php- - -
And the view sitting before you can be found at:
- -APP_PATH/views/home/index.php- -
Create something beautiful.
- -- Now that you're up and running, it's time to start creating! - Here are some links to help you get started: -
- - -@endsection diff --git a/bundles/docs/views/menu.blade.php b/bundles/docs/views/menu.blade.php deleted file mode 100644 index 164556da..00000000 --- a/bundles/docs/views/menu.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -Documentation
--
-
- Menu Item -
- Menu Item -
- Menu Item
-
-
-
- Sub Menu Item -
- Sub Menu Item -
- - Menu Item -
- Menu Item -
- Menu Item
-
-
-
- Sub Menu Item -
- Sub Menu Item -
- Sub Menu Item -
- - Menu Item -
- Menu Item -
- Menu Item -
- Menu Item -
- Menu Item -
- Menu Item -
- Menu Item -
Laravel
A Framework For Web Artisans
-- You have successfully installed the Laravel framework. Laravel is a simple framework - that helps web artisans create beautiful, creative applications using elegant, expressive - syntax. You'll love using it. +