Skip to content
This repository was archived by the owner on Feb 13, 2020. It is now read-only.

Commit 107aea1

Browse files
committed
Merge branch 'master' of git://github.com/kohana/userguide
2 parents e4c9ba7 + 3d44890 commit 107aea1

10 files changed

+42
-43
lines changed

guide/about.install.md

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ There are a few things you'll want to do with your application before moving int
3232
3. Turn on APC or some kind of opcode caching.
3333
This is the single easiest performance boost you can make to PHP itself. The more complex your application, the bigger the benefit of using opcode caching.
3434

35+
[!!] Note: The default bootstrap will set Kohana::$environment = $_ENV['KOHANA_ENV'] if set. Docs on how to supply this variable are available in your web server's documentation (e.g. [Apache](http://httpd.apache.org/docs/1.3/mod/mod_env.html#setenv), [Lighttpd](http://redmine.lighttpd.net/wiki/1/Docs:ModSetEnv#Options), [Nginx](http://wiki.nginx.org/NginxHttpFcgiModule#fastcgi_param)). This is considered better practice than many alternative methods to set Kohana::$enviroment.
36+
3537
/**
3638
* Set the environment string by the domain (defaults to Kohana::DEVELOPMENT).
3739
*/

guide/nl/about.conventions.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,13 @@ Kohana gebruikt underscore namen, geen camelCase.
4242

4343
<?php
4444

45-
// Library, gebruikt _Core achtervoegsel
46-
class Beer_Core {
45+
// Controller class, gebruikt Controller_ voorvoegsel
46+
class Controller_Apple extends Controller {
4747

48-
// Library extension, gebruikt geen achtervoegsel
49-
class Beer extends Beer_Core
48+
// Model class, gebruikt Model_ voorvoegsel
49+
class Model_Cheese extends Model {
5050

51-
// Controller class, gebruikt _Controller achtervoegsel
52-
class Apple_Controller extends Controller {
53-
54-
// Model class, gebruikt _Model achtervoegsel
55-
class Cheese_Model extends Model {
56-
57-
// Helper class
51+
// Regular class
5852
class peanut {
5953

6054
Wanneer je een instantie aanmaakt van een class, gebruik dan haakjes als je niets meegeeft aan de constructor:

guide/nl/about.install.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Er zijn enkele dingen dat je best doet met je applicatie vooraleer je deze in pr
3131
Zie onderstaand voorbeeld van Shadowhand's [wingsc.com broncode](http://github.com/shadowhand/wingsc).
3232
3. Zet APC of een andere soort opcode caching aan. Dit is het enige en eenvoudigste manier om de performantie te verbeteren dat je kunt doen in PHP zelf. Hoe complexer je applicatie, hoe groter het voordeel van opcode caching.
3333

34+
[!!] Opmerking: De standaard bootstrap zal Kohana::$environment = $_ENV['KOHANA_ENV'] instellen indien ingesteld. Documentatie hoe je deze variable moet invullen kan je vinden in je webservers documentatie (e.g. [Apache](http://httpd.apache.org/docs/1.3/mod/mod_env.html#setenv), [Lighttpd](http://redmine.lighttpd.net/wiki/1/Docs:ModSetEnv#Options), [Nginx](http://wiki.nginx.org/NginxHttpFcgiModule#fastcgi_param))). Deze manier wordt als beste beschouwd in vergelijking met de alternatieve manieren om Kohana::$environment in te stellen.
35+
3436
/**
3537
* Stel de omgeving in aan de hand van het domein (standaard Kohana::DEVELOPMENT).
3638
*/

guide/nl/about.kohana.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Alles kan worden uitgebreid door het unieke design van het [filesystem](about.fi
1010

1111
Om je te helpen je applicatie te beveiligen zijn er tools voor [XSS te verwijderen](security.xss), [input validatie](security.validation), [gesigneerde cookies](security.cookies), [formulieren](security.forms) en [HTML](security.html) generators toegevoegd aan het systeem. De [database](security.database) layer voorkomt [SQL injectie](http://wikipedia.org/wiki/SQL_Injection). En natuurlijk, alle officiële code is met zorg geschreven en herbekeken inzake veiligheid.
1212

13-
## Deze documentatie trekt nergens op!
13+
## Vul mee deze documentatie aan
1414

15-
We zijn keihard en volop bezig om je van een complete documentatie te voorzien. Indien je problemen ondervindt bij het zoeken van een antwoord, bekijk dan de [onofficiële wiki (en)](http://kerkness.ca/wiki/doku.php). Als je iets wilt toevoegen of wijzigen in de documentatie, gelieve dan [de gebruiksaanwijzing te forken](http://github.com/kohana/userguide), uw veranderingen te maken, en een pull request zenden. Als je nog geen ervaring hebt met git kan je altijd een [feature request](http://dev.kohanaframework.org/projects/kohana3/issues) aanmaken (vereist registratie).
15+
We zijn keihard en volop bezig om je van een complete documentatie te voorzien. Om deze documentatie te helpen verbeteren, gelieve dan de userguide te [forken](http://github.com/kohana/userguide), uw aanpassingen te doen en een pull request te sturen. Als je nog geen ervaring hebt met git kan je altijd een [feature request](http://dev.kohanaframework.org/projects/kohana3/issues) aanmaken (vereist registratie).

guide/nl/security.validation.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ Merk op dat alle array parameters steeds moeten "verpakt" worden door een array!
102102

103103
Je kan eigen regels toevoegen met behulp van een [PHP callback](http://php.net/manual/language.pseudo-types.php#language.types.callback]:
104104

105-
$post->rule('username', array($model, 'unique_username'));
105+
$post->rule('username', 'User_Model::unique_username');
106106

107-
De methode `$model->unique_username()` zal ongeveer gedefinieerd worden als:
107+
[!!] Momenteel (v3.0.7) is het niet mogelijk om een object te gebruiken als rule, enkel statische methodes en functies.
108108

109-
public function unique_username($username)
109+
De methode `User_Model::unique_username()` zal ongeveer gedefinieerd worden als:
110+
111+
public static function unique_username($username)
110112
{
111113
// Controleer of de username al bestaat in de database
112114
return ! DB::select(array(DB::expr('COUNT(username)'), 'total'))

guide/nl/tutorials.orm.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ORM ondersteunt de meeste krachtige [Database] methoden voor het doorzoeken van
7070

7171
// Dit zal alle gebruikers nemen met de naam Bob
7272
$users = ORM::factory('user')
73-
...
73+
->where('name', '=', 'Bob')
7474
->find_all();
7575

7676
Wanneer je een lijst van modellen ontvangt met behulp van [ORM::find_all], kan je deze doorlopen zoals je doet met database resultaten:
@@ -83,7 +83,7 @@ Wanneer je een lijst van modellen ontvangt met behulp van [ORM::find_all], kan j
8383
Een zeer handige functie van ORM is de [ORM::as_array] methode die het record zal teruggeven als een array. Indien je dit gebruikt met [ORM::find_all], zal een array van alle records worden teruggegeven. Een goed voorbeeld van wanneer dit nuttig is, is voor select in het HTML formulier:
8484

8585
// Toon een dropdown/select met daarin alle gebruikersnamen (id als value van de options)
86-
form::select('user', ORM::factory('user')->find_all()->as_array('id', 'username') ...
86+
echo Form::select('user', ORM::factory('user')->find_all()->as_array('id', 'username'));
8787

8888
### Het aantal records tellen
8989

@@ -119,11 +119,11 @@ Voor het opslaan van gegevens/properties die niet bestaan in de tabel van het mo
119119
class Model_User extends ORM
120120
{
121121
...
122-
protected $_ignored_columns = array('field1', 'field2', ...)
122+
protected $_ignored_columns = array('field1', 'field2', …);
123123
...
124124
}
125125

126-
Meerdere key => value paren kunnen worden ingesteld door gebruik te maken van de [ORM::values] methode
126+
Meerdere key => value paren kunnen worden ingesteld door gebruik te maken van de [ORM::values] methode.
127127

128128
$user->values(array('username' => 'Joe', 'password' => 'bob'));
129129

@@ -156,19 +156,19 @@ Je kan meerdere records tegelijk veranderen met de [ORM::save_all] methode:
156156

157157
De `_updated_column` en `_created_column` members staan ter beschikking om automatisch aangepast te worden wanneer een model wordt gecreëerd of aangepast. Ze worden standaard niet gebruikt. Om ze te gebruiken:
158158

159-
// date_created is de kolom die wordt gebruikt om de aanmaak datum op te slaan. Gebruik TRUE om een timestamp op te slaan
160-
protected $_created_column = array('date_created' => TRUE);
159+
// date_created is de kolom die wordt gebruikt om de aanmaak datum op te slaan. Gebruik format => TRUE om een timestamp op te slaan
160+
protected $_created_column = array('date_created', 'format' => TRUE);
161161

162162
// date_modified is de kolom die wordt gebruikt om de datum op te slaan wanneer het item is aangepast. In dit geval wordt een string gebruikt om een date() formaat te specificeren
163-
protected $_updated_column = array('date_modified' => 'm/d/Y');
163+
protected $_updated_column = array('date_modified', 'format' => 'm/d/Y');
164164

165165
### Verwijderen van records
166166

167167
Records worden verwijderd met [ORM::delete] en [ORM::delete_all]. Deze methoden werken op dezelfde manier als het opslaan van records zoals hierboven beschreven, met de uitzondering dat [ORM::delete] nog een optionele parameter heeft, het `id` van het record om te verwijderen. Anders wordt het huidig ingeladen record verwijderd.
168168

169169
### Relaties
170170

171-
ORM ondersteunt zeer goed relateies. Ruby heeft een goede tutorial omtrent relaties op [http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html)
171+
ORM ondersteunt zeer goed relateies. Ruby heeft een [goede tutorial omtrent relaties](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html).
172172

173173
#### Belongs-To en Has-Many
174174

guide/nl/using.sessions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Het verwijderen van sessie- of cookie-gegevens wordt gedaan met behulp van de `d
7878

7979
Zowel cookies als sessies hebben verschillende configuratie-instellingen die van invloed zijn hoe gegevens worden opgeslagen. Controleer altijd deze instellingen voordat u uw applicatie live zet, omdat veel van die instellingen een rechtstreeks effect zal hebben op de veiligheid van uw applicatie.
8080

81-
## Cookie Instellingen
81+
## Cookie Instellingen {#cookie-settings}
8282

8383
Al de cookie instellingen worden verandert met behulp van statische properties. Je kan deze instellingen veranderen in `bootstrap.php` of door een [class extension](using.autoloading#class-extension) te gebruiken.
8484

guide/tutorials.orm.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ORM supports most of the [Database] methods for powerful searching of your model
7272
$users = ORM::factory('user')
7373
->where('name', '=', 'Bob')
7474
->find_all();
75-
75+
7676
When you are retrieving a list of models using [ORM::find_all], you can iterate through them as you do with database results:
7777

7878
foreach ($users as $user)
@@ -104,10 +104,10 @@ If you wish to count the total number of users for a given query, while only ret
104104

105105
### Accessing Model Properties
106106

107-
All model properties are accessible using the `__get` and `__set` magic methods.
107+
All model properties are accessible using the `__get` and `__set` magic methods.
108108

109109
$user = ORM::factory('user', 5);
110-
110+
111111
// Output user name
112112
echo $user->name;
113113

@@ -157,10 +157,10 @@ You can update multiple records by using the [ORM::save_all] method:
157157
The `_updated_column` and `_created_column` members are provided to automatically be updated when a model is updated and created. These are not used by default. To use them:
158158

159159
// date_created is the column used for storing the creation date. Use format => TRUE to store a timestamp.
160-
protected $_created_column = array('date_created', 'format' => TRUE);
160+
protected $_created_column = array('column' => 'date_created', 'format' => TRUE);
161161

162162
// date_modified is the column used for storing the modified date. In this case, a string specifying a date() format is used.
163-
protected $_updated_column = array('date_modified', 'format' => 'm/d/Y');
163+
protected $_updated_column = array('column' => 'date_modified', 'format' => 'm/d/Y');
164164

165165
### Deleting Records
166166

@@ -195,7 +195,7 @@ To access a school's students, you would use:
195195
By default, ORM will look for a `school_id` model in the student table. This can be overriden by using the `foreign_key` attribute:
196196

197197
protected $_belongs_to = array('school' => array('foreign_key' => 'schoolID'));
198-
198+
199199
The foreign key should be overridden in both the student and school models.
200200

201201
#### Has-One
@@ -239,7 +239,7 @@ To access the related objects, use:
239239
$class->students->find_all();
240240

241241
### Validation
242-
242+
243243
ORM is integrated tightly with the [Validate] library. The ORM provides the following members for validation:
244244

245245
* _rules
@@ -248,7 +248,7 @@ ORM is integrated tightly with the [Validate] library. The ORM provides the foll
248248
* _labels
249249

250250
#### `_rules`
251-
251+
252252
protected $_rules = array
253253
(
254254
'username' => array('not_empty' => array()),
@@ -258,7 +258,7 @@ ORM is integrated tightly with the [Validate] library. The ORM provides the foll
258258
`username` will be checked to make sure it's not empty. `email` will be checked to also ensure it is a valid email address. The empty arrays passed as values can be used to provide optional additional parameters to these validate method calls.
259259

260260
#### `_callbacks`
261-
261+
262262
protected $_callbacks = array
263263
(
264264
'username' => array('username_unique'),
@@ -281,7 +281,7 @@ ORM is integrated tightly with the [Validate] library. The ORM provides the foll
281281
);
282282

283283
`TRUE` indicates that the `trim` filter is to be used on all fields. `username` will be filtered through `stripslashes` before it is validated. The empty arrays passed as values can be used to provide additional parameters to these filter method calls.
284-
284+
285285
#### Checking if the Object is Valid
286286

287287
Use [ORM::check] to see if the object is currently valid.

guide/using.messages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Message Basics
22

3-
Kohana messages are human friendly strings represented by a shorter word or phrase, called a "key". Messages are accessed using the [Kohana::message] method, which an return either an entire group of messages, or a single message.
3+
Kohana messages are human friendly strings represented by a shorter word or phrase, called a "key". Messages are accessed using the [Kohana::message] method, which returns either an entire group of messages, or a single message.
44

55
As an example, when a user is not logged in and attempts to access a page that requires authentication, an error such as "You must be logged in to access this page" might be displayed. This message could be stored in the `auth` file with a `must_login` key:
66

media/css/kodoc.css

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
html { margin: 0; }
22
body { margin: 0 }
33
body.he { direction: rtl }
4-
pre { background: #efefef; padding: 0.4em; border: dotted 1px #ddd; overflow: auto; }
4+
pre { background: #eee; padding: 0.5em 0.6em 0.4em; overflow: auto; }
55
table th { color: #444; background: #eee; }
6-
table td { background: #f4f4f4; }
6+
table td { background: #fafafa; }
77
table tr.alt td { background: #fff; }
88

99
.container .toggle { font-size: 0.7em; float: right; padding: 0 1em; cursor: pointer; color: #777; text-decoration: none; }
@@ -31,10 +31,9 @@ table td { background: #f4f4f4; }
3131

3232
#footer { margin-top: 1em; padding: 1em 0; color: #666; }
3333
#footer p { font-size: 0.8em; text-transform: uppercase; }
34-
#content h1 { margin-top: 0; }
35-
#content h1,
36-
#content h2,
37-
#content h3 { margin-left: -20px; padding: 0.4em 20px; padding-right: 0; background: #eee; }
34+
#content h1 { font-size: 3em; letter-spacing: -0.02em; }
35+
#content h2 { margin-top: 1.5em; margin-left: -20px; padding: 0.6em 20px 0.5em 20px; background: #e5e5e5; font-size: 2em; letter-spacing: -0.01em; text-shadow: 0 -1px 0 #fff; }
36+
#content h3 { border-bottom: 2px solid #eee; font-size: 1.6em; }
3837
#content h1 small,
3938
#content h2 small,
4039
#content h3 small,
@@ -57,7 +56,7 @@ table td { background: #f4f4f4; }
5756
#content div.constants { margin-bottom: 1em; }
5857
#content div.method h3 .param { font-weight: normal; cursor: help; border-bottom:1px dashed #666;}
5958
#content div.method h3 abbr.param { text-transform: none; font-size: 1em; }
60-
#content p.note { display: block; padding: 0.4em 0.6em; padding-left: 3em; background: #efefef url(../img/note.png) 1em 0.6em no-repeat; color: #444; border: solid 1px #eee; }
59+
#content p.note { display: block; padding: 0.4em 0.6em; padding-left: 3em; background: url(../img/note.png) 1em 0.6em no-repeat; border: 1px solid #e5e5e5; font-family: Georgia, serif; font-size: 1.05em; font-style: italic; color: #555; }
6160
#content dl.tags { overflow: auto; background: #eee; padding: 1em; border: solid 6px #ddd; }
6261
#content dl.tags dt { margin: 0 0 0.4em; clear: both; float: left; width: 25%; }
6362
#content dl.tags dd { margin: 0; padding: 0; clear: right; float: right; }

0 commit comments

Comments
 (0)