Top 10 modern and good looking websites

Written on 4 February 2012, 12:19am

Tagged with: ,

The websites below have something in common: they are all modern-looking and there is a lot of attention behind every page. Most important, they are designed for emotion.
Without any other presentation, here they are:

(more…)

Update your copyright year in your blog’s footer!

Written on 2 February 2012, 11:46am

Tagged with: ,

We’re already more than one month into 2012, and I still notice websites showing 2011 in their footer copyright notice.
3 examples:
http://webdesignerwall.com/
http://sixrevisions.com/
http://zipalong.com/

The solution is really simple – use PHP’s date("Y") function to get the current year (or any similar functions for the alternative server side languages). No need to manually update your theme’s footer every 1st of January 🙂

<!-- replace -->
&copy; 2011
<!-- with -->
&copy; <?php echo date("Y"); ?>

Today, the users are scrolling to the end of the page. So it’s more likely for them to discover such simple mistakes that look simply unprofessional. It’s time to fix that!

Cfargument: required and default attributes

Written on 11 January 2012, 03:30pm

Tagged with:

Just noting an interesting observation about the attributes of the cfargument tag.
What happens if you set the required="true" attribute, but also the default attribute?
The answer is in the documentation: if passed, the ‘default‘ attribute is used, and the ‘required‘ attribute is ignored.

required (optional, default=’no’):
Specifies whether the parameter is required to execute the component method. The parameter is not required if you specify a default attribute.
-link

An example below:

dummy.cfc:

<cfcomponent>
	<cffunction name="add">
		<cfargument name="a" required="true" type="string" default="1" />
		<cfargument name="b" required="true" type="string" default="1" />
		<cfreturn a+b>
	</cffunction>
</cfcomponent>

dummy.cfm:

<cfinvoke component="dummy"
	method="add"
	returnVariable="sum" />
<cfoutput>#sum#</cfoutput>

The example below will still output 2, even if we call the ‘add’ method without any argument. The default values are used.