Consider a blank for sites that has good potential for further expansion. Its main features will be indicated, and the installation process will be described in detail.
If the submitted workpiece will be useful to most users, which they will not hesitate to indicate in the comments, then, most likely, its individual modules and features will be considered in the future.
Some functions, code and data mapping are used more for illustrative purposes than for practical use as part of creating a working site.
In the present form, the workpiece can already be used to create simple sites, but with good opportunities for expansion.
The main features are listed in random order, and not in order of importance (some derive from the features of the frameworks used):
- PHP-framework: Kohana v3.2.0.
- CSS framework: Bootstrap.
- HTML5: Apply relevant doctype, standards and tags.
- Availability of authorization and registration: changing the password for an existing user is not yet available.
- Using AJAX requests in the user authorization controller.
- Example Paginator-a for the list of private messages.
- Work with built-in Kohana ORM.
- Multilingual: sections are partially translated into Russian, Ukrainian and English to show the general principle of the future site with multiple languages.
- HMVC: Kohana is based on this programming pattern.
- The ability to edit the content of existing pages under the administrator account.
- Partial filtering and validation of user input.
- Three roles for users: unregistered and registered users, the administrator.
- Comparative installation speed.
- DB: MySQL
- Extensibility, modularity, good structuredness: as a consequence of using the PHP-framework.
- Work with cookies and sessions.
Installation and use.
Consider installing to localhost. We assume that the user's computer has already installed packages like Denwer in the case of Windows or LAMP in the case of Linux. Web server and database running.
Those who have already faced the installation of sites written on Kohana, will understand everything themselves, who still do not know what is at stake, can familiarize yourself with the process below.
1) Download the archive with files
from here . (Tested on
Virustotal .) In response to the comment by user
1010101001000100110100111 : when uploading files from Sendspace, click "Click here to start download from sendspace" on a blue background in the middle of the page. Name there is a link to download the desired file in .zip format, which was directly checked on Virustotal
2) The unpacked archive is moved to an empty \ ... \ localhost \ www \ kohana folder. Now inside this path should be the folder application, media, modules, system and files among which install.php and index.php.
3) If there is already a \ ... \ localhost \ www \ kohana folder on the local web server, or you would like to upload the preset for sites to the root of the site or to another place, then after unpacking you will need to edit the following files first
... \ application \ bootstrap.php
Line:
Kohana :: init (array ('base_url' => '/ kohana /', 'index_file' => '', 'profile' => FALSE));
In the base_url parameter, specify the desired folder name or an empty value when copying the stub files to the local web server root.
In addition, in this file (bootstrap.php) you can and should set the localization settings, for example, time zone and encoding. Read more about it here -
kohanaframework.su .
')
.htaccess
# Installation directory
RewriteBase / kohana - here you substitute your value.
... \ media \ js \ signup.js
var subdomain = "kohana"; - same.
4) Go for the first time at
127.0.0.1/kohana . We will ship to
127.0.0.1/kohana/index.php/install.php automatically. If you get an error, then we drive
127.0.0.1/kohana/index.php/install.php manually into the browser string. Did you see only the green lines under the Environment Tests? Then we continue to work further, otherwise we would have to suffer with the additional installation of the appropriate packages and options for the local web server.
5) Rename or delete install.php.
6) Create a new empty database. Fill it with a dump from the k.sql file located in the root of the workpiece. We register your settings for connecting to the database and the name of the new database in the file ... / application / config / database.php. If everything is ok, delete k.sql.
7) Go back to
127.0.0.1/kohana .
8) We work ...
Name and password for registered user: user - userrr
Administrator name and password: admin - adminn
List of links used:
- kohanaframework.org is the official site of the Kohana framework.
- twitter.github.com/bootstrap - official css page - Bootstrap framework.
- kohanaframework.su is a great Russian blog about Kohana.
- webdesign.tutsplus.com/tutorials/htmlcss-tutorials/stepping-out-with-bootstrap-from-twitter - basic description and use of the css-framework Bootstrap.
- jkeks.ru/jkeks.ru/archives/1853 - Russian translation of the previous link.
- www.workinprogress.ca/kohana32 - most of the description of the stub code is from here.
- github.com/patricksebastien/kohana-3.2-example - and a considerable part of the code is from here.
- ab-w.net/HTML5/html5.php - new HTML5 tags
Used Books:
- Kohana 3.0 Beginner's Guide - Jason D. Straughan Language: English Paperback: 344 pages [235mm x 191mm] Release Date: August 2011 ISBN: 184951240X
The text of the article is distributed under the Creative Commons Attribution-Share Alike 3.0 Unported license.