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

Commit e3e9e89

Browse files
committed
Initialised nl as a translation with recent EN-files as fall back, nothing translated yet except the menu
1 parent 656c7ff commit e3e9e89

36 files changed

+2352
-234
lines changed

guide/nl/start.controllers.md guide/nl/about.controllers.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Controllers stand in between the models and the views in an application. They pass information on to the model when data needs to be changed and they request information from the model. For example database inserts, updates and deletes for data change and database selects for information retrieval. Controllers pass on the information of the model to the views, the views contain the final output for the users.
44

5-
Controllers are called by a URL, see [URLs and Links](start.urls) for more information.
6-
7-
5+
Controllers are called by a URL, see [URLs and Links](about.urls) for more information.
86

97
## Controller naming and anatomy
108

@@ -75,7 +73,7 @@ Article list goes here!
7573

7674
Say we want to display a specific article, for example the article with the title being `your-article-title` and the id of the article is `1`.
7775

78-
The url would look like yoursite.com/article/view/**your-article-title/1** The last two segments of the url are passed on to the view() method.
76+
The url would look like yoursite.com/article/view/**your-article-title/1**. The last two segments of the url are passed on to the view() method.
7977

8078
**application/classes/controller/article.php**
8179
~~~

guide/nl/about.conventions.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Conventions
2+
3+
It is encouraged to follow Kohana's [coding style](http://dev.kohanaframework.org/wiki/kohana2/CodingStyle). This uses [BSD/Allman style](http://en.wikipedia.org/wiki/Indent_style#BSD.2FAllman_style) bracing, among other things.
4+
5+
## Class Names and File Location {#classes}
6+
7+
Class names in Kohana follow a strict convention to facilitate [autoloading](using.autoloading). Class names should have uppercase first letters with underscores to separate words. Underscores are significant as they directly reflect the file location in the filesystem.
8+
9+
The following conventions apply:
10+
11+
1. CamelCased class names should not be used, except when it is undesirable to create a new directory level.
12+
2. All class file names and directory names are lowercase.
13+
3. All classes should be in the `classes` directory. This may be at any level in the [cascading filesystem](about.filesystem).
14+
15+
[!!] Unlike Kohana v2.x, there is no separation between "controllers", "models", "libraries" and "helpers". All classes are placed in the "classes/" directory, regardless if they are static "helpers" or object "libraries". You can use whatever kind of class design you want: static, singleton, adapter, etc.
16+
17+
## Examples
18+
19+
Remember that in a class, an underscore means a new directory. Consider the following examples:
20+
21+
Class Name | File Path
22+
----------------------|-------------------------------
23+
Controller_Template | classes/controller/template.php
24+
Model_User | classes/model/user.php
25+
Database | classes/database.php
26+
Database_Query | classes/database/query.php
27+
Form | classes/form.php

guide/nl/about.filesystem.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Cascading Filesystem
2+
3+
The Kohana filesystem is a heirarchy of directory structure. When a file is
4+
loaded by [Kohana::find_file], it is searched in the following order:
5+
6+
Application Path
7+
: Defined as `APPPATH` in `index.php`. The default value is `application`.
8+
9+
Module Paths
10+
: This is set as an associative array using [Kohana::modules] in `APPPATH/bootstrap.php`.
11+
Each of the values of the array will be searched in the order that the modules
12+
are added.
13+
14+
System Path
15+
: Defined as `SYSPATH` in `index.php`. The default value is `system`. All of the
16+
main or "core" files and classes are defined here.
17+
18+
Files that are in directories higher up the include path order take precedence
19+
over files of the same name lower down the order, which makes it is possible to
20+
overload any file by placing a file with the same name in a "higher" directory:
21+
22+
![Cascading Filesystem Infographic](img/cascading_filesystem.png)
23+
24+
If you have a view file called `welcome.php` in the `APPPATH/views` and
25+
`SYSPATH/views` directories, the one in application will be returned when
26+
`welcome.php` is loaded because it is at the top of the filesystem.
27+
28+
## Types of Files
29+
30+
The top level directories of the application, module, and system paths has the following
31+
default directories:
32+
33+
classes/
34+
: All classes that you want to [autoload](using.autoloading) should be stored here.
35+
This includes controllers, models, and all other classes. All classes must
36+
follow the [class naming conventions](about.conventions#classes).
37+
38+
config/
39+
: Configuration files return an associative array of options that can be
40+
loaded using [Kohana::config]. See [config usage](using.configuration) for
41+
more information.
42+
43+
i18n/
44+
: Translation files return an associative array of strings. Translation is
45+
done using the `__()` method. To translate "Hello, world!" into Spanish,
46+
you would call `__('Hello, world!')` with [I18n::$lang] set to "es-es".
47+
See [translation usage](using.translation) for more information.
48+
49+
messages/
50+
: Message files return an associative array of strings that can be loaded
51+
using [Kohana::message]. Messages and i18n files differ in that messages
52+
are not translated, but always written in the default language and referred
53+
to by a single key. See [message usage](using.messages) for more information.
54+
55+
views/
56+
: Views are plain PHP files which are used to generate HTML or other output. The view file is
57+
loaded into a [View] object and assigned variables, which it then converts
58+
into an HTML fragment. Multiple views can be used within each other.
59+
See [view usage](usings.views) for more information.
60+
61+
## Finding Files
62+
63+
The path to any file within the filesystem can be found by calling [Kohana::find_file]:
64+
65+
// Find the full path to "classes/cookie.php"
66+
$path = Kohana::find_file('classes', 'cookie');
67+
68+
// Find the full path to "views/user/login.php"
69+
$path = Kohana::find_file('views', 'user/login');
70+
71+
72+
# Vendor Extensions
73+
74+
We call extensions that are not specific to Kohana "vendor" extensions.
75+
For example, if you wanted to use [DOMPDF](http://code.google.com/p/dompdf),
76+
you would copy it to `application/vendor/dompdf` and include the DOMPDF
77+
autoloading class:
78+
79+
require Kohana::find_file('vendor', 'dompdf/dompdf/dompdf_config.inc');
80+
81+
Now you can use DOMPDF without loading any more files:
82+
83+
$pdf = new DOMPDF;
84+
85+
[!!] If you want to convert views into PDFs using DOMPDF, try the
86+
[PDFView](http://github.com/shadowhand/pdfview) module.

guide/nl/about.flow.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Request Flow
2+
3+
Every application follows the same flow:
4+
5+
1. Application starts from `index.php`.
6+
2. The application, module, and system paths are set.
7+
3. Error reporting levels are set.
8+
4. Install file is loaded, if it exists.
9+
5. The [Kohana] class is loaded.
10+
6. The bootstrap file, `APPPATH/bootstrap.php`, is included.
11+
7. [Kohana::init] is called, which sets up error handling, caching, and logging.
12+
8. [Kohana_Config] readers and [Kohana_Log] writers are attached.
13+
9. [Kohana::modules] is called to enable additional modules.
14+
* Module paths are added to the [cascading filesystem](about.filesystem).
15+
* Includes the module `init.php` file, if it exists.
16+
* The `init.php` file can perform additional environment setup, including adding routes.
17+
10. [Route::set] is called multiple times to define the [application routes](using.routing).
18+
11. [Request::instance] is called to start processing the request.
19+
1. Checks each route that has been set until a match is found.
20+
2. Creates the controller instance and passes the request to it.
21+
3. Calls the [Controller::before] method.
22+
4. Calls the controller action, which generates the request response.
23+
5. Calls the [Controller::after] method.
24+
* The above 5 steps can be repeated multiple times when using [HMVC sub-requests](about.mvc).
25+
12. The main [Request] response is displayed
26+
27+
## index.php
28+
29+
Kohana follows a [front controller] pattern, which means that all requests are sent to `index.php`. This allows a very clean [filesystem](about.filesystem) design. In `index.php`, there are some very basic configuration options available. You can change the `$application`, `$modules`, and `$system` paths and set the error reporting level.
30+
31+
The `$application` variable lets you set the directory that contains your application files. By default, this is `application`. The `$modules` variable lets you set the directory that contains module files. The `$system` variable lets you set the directory that contains the default Kohana files.
32+
33+
You can move these three directories anywhere. For instance, if your directories are set up like this:
34+
35+
www/
36+
index.php
37+
application/
38+
modules/
39+
system/
40+
41+
You could move the directories out of the web root:
42+
43+
application/
44+
modules/
45+
system/
46+
www/
47+
index.php
48+
49+
Then you would change the settings in `index.php` to be:
50+
51+
$application = '../application';
52+
$modules = '../modules';
53+
$system = '../system';
54+
55+
Now none of the directories can be accessed by the web server. It is not necessary to make this change, but does make it possible to share the directories with multiple applications, among other things.
56+
57+
[!!] There is a security check at the top of every Kohana file to prevent it from being accessed without using the front controller. However, it is more secure to move the application, modules, and system directories to a location that cannot be accessed via the web.
58+
59+
### Error Reporting
60+
61+
By default, Kohana displays all errors, including strict mode warnings. This is set using [error_reporting](http://php.net/error_reporting):
62+
63+
error_reporting(E_ALL | E_STRICT);
64+
65+
When you application is live and in production, a more conservative setting is recommended, such as ignoring notices:
66+
67+
error_reporting(E_ALL & ~E_NOTICE);
68+
69+
If you get a white screen when an error is triggered, your host probably has disabled displaying errors. You can turn it on again by adding this line just after your `error_reporting` call:
70+
71+
ini_set('display_errors', TRUE);
72+
73+
Errors should **always** be displayed, even in production, because it allows you to use [exception and error handling](debugging.errors) to serve a nice error page rather than a blank white screen when an error happens.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Installation
22

3-
1. Download the latest **stable** release from the [Kohana website](http://kohanaphp.com/)
3+
1. Download the latest **stable** release from the [Kohana website](http://kohanaframework.org/)
44
2. Unzip the downloaded package to create a `kohana` directory
55
3. Upload the contents of this folder to your webserver
66
4. Open `application/bootstrap.php` and make the following changes:
77
- Set the default [timezone](http://php.net/timezones) for your application
88
- Set the `base_url` in the [Kohana::init] call to reflect the location of the kohana folder on your server
9-
6. Make sure the `application/cache` and `application/logs` directories are world writable with `chmod application/{cache,logs} 0777`
9+
6. Make sure the `application/cache` and `application/logs` directories are writable by the web server
1010
7. Test your installation by opening the URL you set as the `base_url` in your favorite browser
1111

1212
[!!] Depending on your platform, the installation's subdirs may have lost their permissions thanks to zip extraction. Chmod them all to 755 by running `find . -type d -exec chmod 0755 {} \;` from the root of your Kohana installation.
1313

14-
You should see the installation page. If it reports any errors, you will need to correct them before contining.
14+
You should see the installation page. If it reports any errors, you will need to correct them before continuing.
1515

1616
![Install Page](img/install.png "Example of install page")
1717

18-
Once your install page reports that your environment is set up correctly you need to either rename or delete `install.php` in the root directory. You should then see the Kohana welcome page. (?? Currently just 'Hello World!' in KO3 ??)
18+
Once your install page reports that your environment is set up correctly you need to either rename or delete `install.php` in the root directory. You should then see the Kohana welcome page:
1919

20+
![Welcome Page](img/welcome.png "Example of welcome page")

guide/nl/about.kohana.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# What is Kohana?
2+
3+
Kohana is an open source, [object oriented](http://wikipedia.org/wiki/Object-Oriented_Programming) [MVC](http://wikipedia.org/wiki/Model–View–Controller "Model View Controller") [web framework](http://wikipedia.org/wiki/Web_Framework) built using [PHP5](http://php.net/manual/intro-whatis "PHP Hypertext Preprocessor") by a team of volunteers that aims to be swift, secure, and small.
4+
5+
[!!] Kohana is licensed under a [BSD license](http://kohanaframework.org/license), so you can legally use it for any kind of open source, commercial, or personal project.
6+
7+
## What makes Kohana great?
8+
9+
Anything can be extended using the unique [filesystem](about.filesystem) design, little or no [configuration](about.configuration) is necessary, [error handling](debugging.errors) helps locate the source of errors quickly, and [debugging](debugging) and [profiling](debugging.profiling) provide insight into the application.
10+
11+
To help secure your applications, tools for [XSS removal](security.xss), [input validation](security.validation), [signed cookies](security.cookies), [form](security.forms) and [HTML](security.html) generators are all included. The [database](security.database) layer provides protection against [SQL injection](http://wikipedia.org/wiki/SQL_Injection). Of course, all official code is carefully written and reviewed for security.
12+
13+
## This Documentation Sucks!
14+
15+
We are working very hard to provide complete documentation. If you are having trouble finding an answer, check the [unofficial wiki](http://kerkness.ca/wiki/doku.php). If you would like to add or change something in the guide, please [fork the userguide](http://github.com/kohana/userguide), make your changes, and send a pull request. If you are not familar with git, you can also submit a [feature request](http://dev.kohanaframework.org/projects/kohana3/issues) (requires registration).

guide/nl/about.mvc.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# (Hierarchical) Model View Controller
2+
3+
Model View Controller (Or MVC for short) is a popular design pattern that separates your data sources (Model) from the presentation/templates (View) and the request logic (Controller).
4+
5+
It makes it much easier to develop applications as the system is designed to maximise the code reuse, meaning you don't have to write as much!
6+
7+
[!!] Stub

guide/nl/about.translation.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Translation
2+
3+
[!!] This article is a stub!
4+

0 commit comments

Comments
 (0)