source code bean

Archive for February, 2009

23 Feb, 2009

Friendly URLs and the Zend Router

Posted by: Peter In: PHP| Zend Framework

Creating custom friendly URLs using the Zend framework is really simple. The default routing setup for Zend is : ‘:module/:controller/:action/*’, (* will match any var/value) which is fine for most setups. However on some pages having the var/value might not look very good, for example this url is not very readable:
/popular/index/type/images/page/1/sortOrder/alltime (controller/action/var/value/var/value/var/value)
We [...]

Zend Framework ships with several View Helpers, such as the url View Helper. Anywhere in a view script one can call $this->url() to generate a url to a certain page. For example:

$this->url(array(

  ‘module’ => ‘moduleName’,

  ‘action’ => ‘actionName’,

  ‘additionalParam’ =>‘value’))

I wanted to create my own helper, for generating paths to thumbnails, and it turned out [...]

13 Feb, 2009

Welcome to Source Code Bean!

Posted by: Peter In: General

So I thought I should introduce myself to my readers. My name is Peter Moberg and I am a Software Engineer from Sweden. I took my masters in computer science at Chalmers University of Technology in the spring of 2007. After this I was offered to move to the Bay Area in California (hello San [...]


Categories

Adwords

Twitter Updates


    • Petan: I got in bootstrap this (insted of $frontController->getRouter()): $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'rout
    • oanh tong ngoc: :) It's usefull but could U give everyone's an example with a project source code. Thanks
    • Peter: Hi Sohaib, It seems like the rewrite module isn't loaded by IIS. Have you uploaded the UrlRewriter dlls and made the changes to web.config on the ser

    About

    Welcome to source code bean! You will find information on tips and tricks on programming languages, server side stuff, and anything that causes troubles to web development.