Commit 7463c522 authored by Taylor Otwell's avatar Taylor Otwell

added comments for language class.

parent efed3b6e
......@@ -39,7 +39,7 @@ class Input {
/**
* Get all of the input data for the request.
*
* This method returns a merged array containing $input->get() and $input->files().
* This method returns a merged array containing Input::get() and Input::files().
*
* @return array
*/
......@@ -51,6 +51,8 @@ class Input {
/**
* Determine if the input data contains an item.
*
* If the item is in the input array, but is an empty string, false will be returned.
*
* @param string $key
* @return bool
*/
......@@ -64,6 +66,14 @@ class Input {
*
* This method should be used for all request methods (GET, POST, PUT, and DELETE).
*
* <code>
* // Get the "email" item from the input array
* $email = Input::get('email');
*
* // Return a default value if the specified item doesn't exist
* $email = Input::get('name', 'Taylor');
* </code>
*
* @param string $key
* @param mixed $default
* @return mixed
......@@ -87,6 +97,14 @@ class Input {
/**
* Get input data from the previous request.
*
* <code>
* // Get the "email" item from the old input
* $email = Input::old('email');
*
* // Return a default value if the specified item doesn't exist
* $email = Input::old('name', 'Taylor');
* </code>
*
* @param string $key
* @param mixed $default
* @return string
......@@ -106,6 +124,14 @@ class Input {
/**
* Get an item from the uploaded file data.
*
* <code>
* // Get the array of information for the "picture" upload
* $picture = Input::file('picture');
*
* // Get a specific element from the file array
* $size = Input::file('picture.size');
* </code>
*
* @param string $key
* @param mixed $default
* @return array
......@@ -120,6 +146,11 @@ class Input {
*
* This method is simply a convenient wrapper around move_uploaded_file.
*
* <code>
* // Move the "picture" item from the $_FILES array to a permanent location
* Input::upload('picture', 'path/to/storage/picture.jpg');
* </code>
*
* @param string $key
* @param string $path
* @return bool
......
......@@ -59,6 +59,14 @@ class Lang {
/**
* Create a new language line instance.
*
* <code>
* // Create a new language line instance for a given line
* $line = Lang::line('validation.required');
*
* // Specify some replacements for the language line
* $line = Lang::line('validation.required', array('attribute' => 'email'));
* </code>
*
* @param string $key
* @param array $replacements
* @param string $language
......@@ -73,7 +81,21 @@ class Lang {
}
/**
* Get the language line.
* Get the language line as a string.
*
* If a language is specified, it should correspond to a directory within
* your application language directory.
*
* <code>
* // Get a language line
* $line = Lang::line('validation.required')->get();
*
* // Get a language line in a specified language
* $line = Lang::line('validation.required')->get('sp');
*
* // Return a default value if the line doesn't exist
* $line = Lang::line('validation.required', null, 'Default');
* </code>
*
* @param string $language
* @param string $default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment