fixing merge issues for comment tweaks
This commit is contained in:
@@ -21,7 +21,7 @@ Bundles are the heart of the improvements that were made in Laravel 3.0. They ar
|
||||
<a name="creating-and-registering"></a>
|
||||
## Creating Bundles
|
||||
|
||||
The first step in creating a bundle is to create a folder for the bundle within your **bundles** directory. For this example, let's create an "admin" bundle, which could house the administrator back-end to our application. The **application/start.php** file provides some basic configuration that helps to define how our application will run. Likewise we'll create a **start.php** file within our new bundle folder for the same purpose. It is run everytime the bundle is loaded. Let's create it:
|
||||
The first step in creating a bundle is to create a folder for the bundle within your **bundles** directory. For this example, let's create an "admin" bundle, which could house the administrator back-end to our application. The **application/start.php** file provides some basic configuration that helps to define how our application will run. Likewise we'll create a **start.php** file within our new bundle folder for the same purpose. It is run every time the bundle is loaded. Let's create it:
|
||||
|
||||
#### Creating a bundle start.php file:
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ Want to join on a different foreign key? No problem. Just pass it in the second
|
||||
|
||||
return $this->has_many('Comment', 'my_foreign_key');
|
||||
|
||||
You may be wondering: _If the dynamic properties return the relationship and require less keystokes, why would I ever use the relationship methods?_ Actually, relationship methods are very powerful. They allow you to continue to chain query methods before retrieving the relationship. Check this out:
|
||||
You may be wondering: _If the dynamic properties return the relationship and require less keystrokes, why would I ever use the relationship methods?_ Actually, relationship methods are very powerful. They allow you to continue to chain query methods before retrieving the relationship. Check this out:
|
||||
|
||||
echo Post::find(1)->comments()->order_by('votes', 'desc')->take(10)->get();
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ You may also specify multiple conditions for an **ON** clause by passing a Closu
|
||||
$join->on('users.id', '=', 'phone.user_id');
|
||||
$join->or_on('users.id', '=', 'phone.contact_id');
|
||||
})
|
||||
->get(array('users.email', 'phone.numer'));
|
||||
->get(array('users.email', 'phone.number'));
|
||||
|
||||
<a name="ordering"></a>
|
||||
## Ordering Results
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a name="the-basics"></a>
|
||||
## The Basics
|
||||
|
||||
The Schema Bulder provides methods for creating and modifying your database tables. Using a fluent syntax, you can work with your tables without using any vendor specific SQL.
|
||||
The Schema Builder provides methods for creating and modifying your database tables. Using a fluent syntax, you can work with your tables without using any vendor specific SQL.
|
||||
|
||||
*Further Reading:*
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ IoC containers help make your application more flexible and testable. Since you
|
||||
});
|
||||
|
||||
|
||||
Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the intial instance is created. Just tell the container the object should be a singleton:
|
||||
Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the initial instance is created. Just tell the container the object should be a singleton:
|
||||
|
||||
#### Registering a singleton in the container:
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ Need to retrieve the line in a language other than your default? Not a problem.
|
||||
<a name="replace"></a>
|
||||
## Place Holders & Replacements
|
||||
|
||||
Now, let's work on our welcome message. "Welcome to our website!" is a pretty generic message. It would be helpful to be able to specify the name of the person we are welcoming. But, creating a language line for each user of our application would be time-consuming and ridiculous. Thankfully, you don't have to. You can specify "place-holders" within your language lines. Place-holders are preceeded by a colon:
|
||||
Now, let's work on our welcome message. "Welcome to our website!" is a pretty generic message. It would be helpful to be able to specify the name of the person we are welcoming. But, creating a language line for each user of our application would be time-consuming and ridiculous. Thankfully, you don't have to. You can specify "place-holders" within your language lines. Place-holders are preceded by a colon:
|
||||
|
||||
#### Creating a language line with place-holders:
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The **detail** option indicates if the framework should display the error messag
|
||||
|
||||
To enable logging, set the **log** option in the error configuration to "true". When enabled, the Closure defined by the **logger** configuration item will be executed when an error occurs. This gives you total flexibility in how the error should be logged. You can even e-mail the errors to your development team!
|
||||
|
||||
By default, logs are stored in the **storage/logs** direcetory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages.
|
||||
By default, logs are stored in the **storage/logs** directory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages.
|
||||
|
||||
<a name="the-logger-class"></a>
|
||||
## The Logger Class
|
||||
|
||||
@@ -62,7 +62,7 @@ Sometimes you may need to determine if the current URI is a given string, or beg
|
||||
// This request is over HTTPS!
|
||||
}
|
||||
|
||||
#### Determing if the current request is an AJAX request:
|
||||
#### Determining if the current request is an AJAX request:
|
||||
|
||||
if (Request::ajax())
|
||||
{
|
||||
|
||||
@@ -99,14 +99,14 @@ If a request enters your application but does not match any existing route, the
|
||||
|
||||
You are free to change this to fit the needs of your application!
|
||||
|
||||
*Futher Reading:*
|
||||
*Further Reading:*
|
||||
|
||||
- *[Events](/docs/events)*
|
||||
|
||||
<a name="filters"></a>
|
||||
## Filters
|
||||
|
||||
Route filters may be run before or after a route is executed. If a "before" filter returns a value, that value is considered the response to the request and the route is not executed, which is conveniont when implementing authentication filters, etc. Filters are typically defined in **application/routes.php**.
|
||||
Route filters may be run before or after a route is executed. If a "before" filter returns a value, that value is considered the response to the request and the route is not executed, which is convenient when implementing authentication filters, etc. Filters are typically defined in **application/routes.php**.
|
||||
|
||||
#### Registering a filter:
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ In the example above, the custom required message will be used for the email att
|
||||
|
||||
However, if you are using many custom error messages, specifying inline may become cumbersome and messy. For that reason, you can specify your custom messages in the **custom** array within the validation language file:
|
||||
|
||||
#### Adding custom error messages to the validation langauge file:
|
||||
#### Adding custom error messages to the validation language file:
|
||||
|
||||
'custom' => array(
|
||||
'email_required' => 'We need to know your e-mail address!',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<a name="entities"></a>
|
||||
## Entities
|
||||
|
||||
When displaying user input in your Views, it is important to convert all characters which have signifance in HTML to their "entity" representation.
|
||||
When displaying user input in your Views, it is important to convert all characters which have significance in HTML to their "entity" representation.
|
||||
|
||||
For example, the < symbol should be converted to its entity representation. Converting HTML characters to their entity representation helps protect your application from cross-site scripting:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<a name="the-basics"></a>
|
||||
## The Basics
|
||||
|
||||
Your application probably uses a common layout across most of its pages. Manually creating this layout within every controller action can be a pain. Specifying a controller layout will make your develompent much more enjoyable. Here's how to get started:
|
||||
Your application probably uses a common layout across most of its pages. Manually creating this layout within every controller action can be a pain. Specifying a controller layout will make your development much more enjoyable. Here's how to get started:
|
||||
|
||||
#### Specify a "layout" property on your controller:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user