Changeset 179

Show
Ignore:
Timestamp:
04/11/07 08:54:30 (2 years ago)
Author:
bermiferrer
Message:

Adding French and Spanish tutorial Translations

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wiki/Tutorial.wiki

    r175 r179  
    1 #labels Featured,Phase-Implementation,Phase-Deploy,Tutorial 
    21= Creating a simple application using the Akelos Framework = 
    32 
     
    5150}}} 
    5251 
    53 And change the `#!/usr/bin/env php` at the beginning of these files `script/console`, `script/generate`, `script/migrate`, `script/setup` and `script/test` to you php binary path. 
     52And change the `#!/usr/bin/env php` at the beginning of these files `script/console`, `script/generate`, `script/migrate`, `script/setup` and `script/test` to your php binary path. 
    5453 
    5554*Note for Windows users:* You will need to call the scripts from your application directory using the full path to your php.exe file like: 
     
    6665 
    6766  1. Create an Akelos application in a different folder and link it to the Framework libraries. 
    68   1. Start coding our application from this folder with the security implications that has making available to the visitors of your site all your Application models, views, 3rd party libraries and so on. 
    69  
    70 As you might have guessed we go with the first option and will create a linked Akelos application which will only expose the public folder to the world. Changing the Framework paths is really simple in Akelos, all you have to do is define in your configuration file where each component is located, but we will leave this for a future tutorial about designing an application for distributing it. 
     67  1. Start coding your application from this folder with the security implications that has making available to the visitors of your site all your Application models, views, 3rd party libraries and so on. 
     68 
     69As you might have guessed you should go with the first option and create a linked Akelos application which will only expose the public folder to the world. Changing the Framework paths is really simple in Akelos, all you have to do is define in your configuration file where each component is located, but we will leave this for a future tutorial about designing an application for distributing it. 
    7170 
    7271Assuming you’ve downloaded the framework to `HOME_DIR/akelos` and that you are inside the `akelos` directory you will check available options for setting up your new application by running 
     
    121120=== Creating a database for your application === 
    122121 
    123 Next thing you’ll need is to create a database your your application. If you intend to use SQLite on PHP5 skip this step. 
    124  
    125 Creating a MySQL database is out of the scope of this tutorial so you might need to google how to do this on your system or just try this common scenario where we will create database for 3 different environments (production, development and testing). 
     122Next thing you’ll need is to create a database for your application. If you intend to use SQLite on PHP5 skip this step. 
     123 
     124Creating a MySQL database is out of the scope of this tutorial so you might need to google how to do this on your system or just try this common scenario where you can create 3 different databases one for each different environment (production, development and testing). 
    126125 
    127126{{{ 
     
    137136}}} 
    138137 
    139 If you are on a shared hosted server you might need to create it from your hosting company control panel. 
     138If you are on a shared hosted server you might need to create it from your hosting provider control panel. 
    140139 
    141140=== Generating the configuration file === 
     
    193192}}} 
    194193 
    195 That’s enough for Akelos to create our database schema. If you just specify the column name, Akelos will default to the best data type based on database normalization conventions. If you want to have full control over your table settings, you can use [http://phplens.com/lens/adodb/docs-datadict.htm php Adodb Datadict syntax] 
     194That’s enough for Akelos to create your database schema. If you just specify the column name, Akelos will default to the best data type based on database normalization conventions. If you want to have full control over your table settings, you can use [http://phplens.com/lens/adodb/docs-datadict.htm php Adodb Datadict syntax] 
    196195 
    197196Now we need to execute the installer with the command 
     
    204203 
    205204*BOOKS TABLE* 
     205 
    206206{{{ 
    207207+--------------+--------------+------+-----+----------------+ 
     
    217217 
    218218*AUTHORS TABLE* 
     219 
    219220{{{ 
    220221+-------+--------------+------+-----+----------------+ 
     
    230231Akelos follows the [http://en.wikipedia.org/wiki/Model-view-controller MVC design pattern] for organizing your application. 
    231232 
    232 Akelos MVC diagram. 
     233http://akelosframework.googlecode.com/svn/trunk/docs/images/akelos_mvc.png 
    233234 
    234235=== Your application files and the Akelos Naming conventions === 
     
    260261=== Meet the Scaffold generator === 
    261262 
    262 You will create a base skeleton for interacting with the *booklink* database created before. In order to get this skeleton quickly you can use the _scaffold generator_ like this 
     263You will generate a base skeleton for interacting with the *booklink* database created before. In order to get this skeleton quickly you can use the _scaffold generator_ like this 
    263264 
    264265{{{ 
     
    272273}}} 
    273274 
    274 This will generate a bunch of files and folder with code that really works!. Don’t trust me? Try it yourself. Point your browser to http://localhost/booklink/author and http://localhost/booklink/books to start adding authors and books. Create some records and come back for an explanation of what is going under the hood. 
     275This will generate a bunch of files and folders with code that really works!. Don’t trust me? Try it yourself. Point your browser to http://localhost/booklink/author and http://localhost/booklink/books to start adding authors and books. Create some records and come back for an explanation of what is going under the hood. 
    275276 
    276277== The Akelos Workflow == 
     
    324325{{{ 
    325326<?php 
    326  
    327 class BookController extends ApplicationController 
    328 
    329     var $models = 'book, author'; // <- make this models available 
    330  
    331     // ... more BookController code 
    332  
    333     function show() 
    334     { 
    335         // Replace "$this->book = $this->Book->find(@$this->params['id']);" 
    336         // with this in order to find related authors. 
    337         $this->book = $this->Book->find(@$this->params['id'], array('include' => 'author')); 
    338     } 
    339  
    340     // ... more BookController code 
    341 
     327 class BookController extends ApplicationController 
     328 { 
     329     var $models = 'book, author'; // <- make this models available 
     330     // ... more BookController code 
     331     function show() 
     332     { 
     333         // Replace "$this->book = $this->Book->find(@$this->params['id']);" 
     334         // with this in order to find related authors. 
     335         $this->book = $this->Book->find(@$this->params['id'], array('include' => 'author')); 
     336     } 
     337     // ... more BookController code 
     338 } 
    342339}}} 
    343340