The Twelve Days of Scaleout

MySQL No Comments »

On the MySQL website can be found some articles posted under the name of: “The Twelve Days of Scaleout”, this articles talks about success stories at clients which are using MySQL services. In this articles you can find case studies on website and services like: Wikipedia (the world largest online encyclopedia), Zimbra (a leader in open source collaboration software), Alcatel (where MySQL implemented Cluster Carrier Edition database), ofcourse there are more case studies all of them are largely described on the MySQL website on the Press Releases section.

Safari 3 for Windows

Internet No Comments »

Apple released a version of their browser Safari for Windows Xp and Vista. You can found it here and you can download it for free. Now Apple made both iTunes and Safari available for Windows. Safari 3 is a beta version, on the Apple website it’s said that Safari is twice as fast as Internet Explorer.
I download it and tested and I’m quite impressed by it, but most of the time I will remain to the Firefox 2.0 I think.

CakePHP – Some controller functions

CakePHP No Comments »

Interacting with your views:

set($variable, $value);
string $variable;
mixed $value;

The principal use of this function is to extract data from a controller and transfer it to a view.
It can be used to transfer single values, whole arrays and so on etc. The moment you utilize set(), the variable can be accessed in your view: doing set(name, john) in your controller makes the variable name available in the view.

validateErrors() – displays the number of all the errors produced by an unsuccessful save.
validate() – this function is used to validate a model data respecting the rules of validation defined in to the model.

render($action, $layout, $file) – this function may not always be needed because render is called by default when every controller action ends, so the view specific to your action is rendered. On the other side, you can call this function to render the view anywhere in the controller code.

CakePHP – About Controllers

CakePHP No Comments »

The role of a controller is that of administering the logic for a special section of your application. In general controllers are utilized in administering the logic for only one model. To take as an example if you were to make up a website that directs a rental-library, you could use a BooksController and a RentalController to administer both your rentals and your books.
Note that in Cake Controller names are only plural.

The controllers of your application are classes that extends the Cake ApplicationController class, which also extends a core Controller class. Controllers may comprise many kinds of actions: functions that are utilized in your web application to show off data in views.

ApplicationController class can be described in /app/appController.php and it may include methods that are distributed among controllers. It itself extends the Controller class which is a standardized in Cake Library.

A controller has an action as it’s single functionality. The Dispatcher directs it automatically if any incoming page request details in routes configuration. Going back to our example with the rental-library, our BooksController is supposed to include the view(), rent(), and search() actions.
The controller should be situated in /app/controllers/bookscontroller.php and include:

  1. class BooksController extends AppController{
  2.   function view($id)
  3.   {
  4.     //logic here...
  5.   }
  6.   function rent($customer_id, $video_id)
  7.   {
  8.     //logic here...
  9.   }
  10.   function search($query)
  11.   {
  12.     //logic here...
  13.   }
  14. }

You should be capable to access these actions using the example URLs:

The data displayed on this pages can be easily formated from the views area, for example for the rent() action we will have: /app/views/books/rent/index.thtml and so on.

Theme designed by N.Design Studio
Entries RSS Comments RSS Log in