September 6th, 2010 |
CakePhp
Virtual fields in cakephp are used as an alias in sql expressions. Alias is used to give a column a different name.
Example, to concatenate fields,
class Applicant extends AppModel {
var $name = 'Applicant';
var $virtualFields = array( 'name' => "CONCAT(Applicant.firstname, ' ', Applicant.lastname)" );
}
To access the virtual field
$this->Applicant->find( 'first', array( 'fields' => array( 'name' ) ) );
June 4th, 2010 |
Mac
Any unsaved application data will not be saved once an application was forced to quit. Do it only if necessary.
When to force quit an application? Only when its unresponsive and cannot be quit in a usual manner.
Read more…
June 4th, 2010 |
Mootools
Scrolling to the top and bottom is very easy in mootools. Check out the code below.
window.addEvent('domready', function(){
var myFx = new Fx.Scroll(window);
$('bottom').addEvent('click', function(e){
e.stop();
myFx.toBottom();
});
$('top').addEvent('click', function(e){
e.stop();
myFx.toTop();
});
});
Lines 5-8 lets you scroll to the bottom of the page. While lines 10-13 lets you scroll to the top of the page. Easy huh?
Note: Fx.Scroll plugin must be included. Get it at Mootools More Builder.
Check out the demo
June 1st, 2010 |
Mootools
Using Fx.slide in Cakephp is very easy. In this tutorial, I assume you know how the MVC works and how to create one.
First, include the javascript in the head section of the default.ctp file. There are only two javascript files. They are the mootools.js( core ) and slider.js. Put these files inside /app/webroot/js.
Read more…
May 30th, 2010 |
Mootools
This tutorial will show how to animate a content when a delete link is clicked. The script is based on wordpress comment deletion.
Create first a html file and put the following code inside the body.
Read more…