Facebook Page for The Lounge Forums is a major success!

December 13th, 2009

We have been very surprised at seeing how many people that have joined our new The Lounge Forums fan Page at Facebook within the short amount of time that it has been online.

The page has been online for around one month, and already it has 59+ members and is still growing quite fast. We still haven’t defined a definite strategy for how we are going to ultilize the page, however it’s mere existance is like a completely free advertisement.

How do we promote it? We have a fan page widget on The Lounge Forums, near the bottom on all topic pages.

ZF: Alternatives to using $this->action and ActionStack

November 12th, 2009

Most people who start out using Zend Framework quickly come to use these two very nice features of the framework. However that may not always be the best options. The fact is that both of these approaches to executing additional actions are very hard to debug and slow (the framework has to do a full dispatch cycle for each additional action).

$this->action

The built in action view helper allows you to execute another action within your view script and echo its output directly. This is a very easy to use and powerful way to re-use actions. The action view helper is very often used in layouts to put the results of different actions into different parts of the layout.

AcitonStack

The ActionStack Front Controller plugin allows you to, in your bootstrap code, or in the action being executed, say “hey do this other action(s) also”. And so after the current request (action) has finished executing, but before the layout plugin is executed these other actions that you pushed to the stack are executed. These actions may then put their output into
different output segments on the layout – thus the ActionStack becomes a prettier and much more flexible way of putting results of different actions into different areas of your layout.

How to avoid it

The key to why you can, to a great degree, avoid using the action view helper and the ActionStack plugin in your Zend Framework application lies in the fact that you can easily access the view and the layout (thus also the individual layout output segments/areas) from your controller action function. One common use-case is where you have a layout with a menu to be included on all pages, but which is built from a database query, and a main (default) content area, plus an additional action/controller dependent content area. This is how I suggest solving this:

Query the database in your own view helper

There is nothing wrong with doing database queries in your view helpers (through a model class). It is a general misconception that view scripts and view helpers should not use the model, but there is nothing wrong with that! What they should NOT do is CHANGE the model. So: The menu, based on a database query, should be echo’ed into your layout script directly using a view helper – NOT an independent action, ie. in your layout script:

<?=$this->menu()?>

Access the view and layout directly from your controller class

It is easy in your action function to add output to a different part/output segment of the layout. Just access the layout segment directly! Thus say you use a output segment called ‘right’ in your layout, you would then put content in that way from your action function (or, if all actions should add the same content to the ‘right’ area, in your preDispatch function) directly
into the segment:

Most effective
$this->view->layout()->right = $this->view->render(’/path/to/viewscript.php’);
(running in the current view namespace)

Slightly less effective
$this->view->layout()->right = $this->view->partial(’/path/to/viewscript.php’, $data);
(running in its own view namespace)

If you absolutely MUST, you can also do the same thing with the action view helper:
$this->view->layout()->right = $this->view->action(’action’,'controller’);
(thus you can completely avoid using the ActionStack for putting action (or controller) specific contents into different parts of your layout)

You can also, like you can with ActionStack, just add, or prepend stuff to the output segment:

$this->view->layout()->right .= $this->view->render(’/path/to/viewscript.php’);
or
$this->view->layout()->right = $this->view->render(’/path/to/viewscript.php’).$this->view->layout()->right;

Final words

I hope that this post has been useful for you. Not using the action view helper and the ActionStack plugin will make your application faster and easier to debug. Most importantly though, your application will be easier to understand, because one request will always equal exactly one action!

Xtreme Cheats redesign/re-coded

October 31st, 2009

Xtreme Cheats ( lorn.com ) has been relaunched with a brand new (yes we know, nothing special) design and all in all it has been completely re-coded using Zend Framework. At this time we have focused on the new code-base and design, so we haven’t added new functionality to the site, however we are planning numerous new web 2.0 features for the site over the comming months.

MovieCodec: New frontpage and URL tweaks

October 23rd, 2009

We have made significant changes to moviecodec.com over the last couple of weeks. The two most noticeable changes include the new frontpage (which so far seem to do the job better in terms of a reduced frontpage bounce rate), and the tweaks to the URLs. That is, each topic or forum now has a fully readable url with forum name and topic name in the URL.

Other changes includes redesigned download pages and additions to our internal tools to combat spam, and to mass delete spam listings once particular patterns are identified. We will continue our efforts to combat spam and create even more effective shields against it.

lunkwill.net relaunched with wordpress

September 15th, 2009

We find that this is the easiest way to manage this site. There is really no need for the custom coded site that there used to be here, as the site does not need to offer any pariticular functionality.

Here is a breakdown of the contents:

  • About: General information on what we do
  • Contact: Find out how to contact us
  • People: Learn more about the people behind lunkwill.net
  • Books: Where Bjarne Lundgren writes a few words on his sentiments on the many tech related books that he reads.