Logo

Maarten Balliauw {blog}

ASP.NET, ASP.NET MVC, Windows Azure, PHP, ...

About the author

Maarten Balliauw is currently employed as a Technical Evangelist at JetBrains. His interests are mainly web applications developed in ASP.NET (C#) or PHP and the Windows Azure cloud platform.
More about me More about me
Send mail E-mail me


ASP.NET MVC Quickly Pro NuGet Subscribe to my RSS feed Follow me on Twitter! View Maarten Balliauw's profile on LinkedIn
Maarten Balliauw - MVP - Most Valuable Professional
Maarten Balliauw - ASPInsider

Search

Archive

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright Maarten Balliauw 2013


Zend Framework custom route

Today, I was once again testing the Zed Framework. One of the things I was trying to do, is creating URL's in different languages. What I did was creating a controller 'user', with the action 'edit' (i.e. www.example.com/user/edit). Now, I want this to be available in Dutch too (i.e. www.example.com/gebruiker/bewerken).

The trick is to add custom routes, which map back to the real controller and action. In my case, adding the following in my index.php did the job:

$router->addRoute('customroute1',
new Zend_Controller_Router_Route('gebruiker/bewerken',
array('controller' => 'user', 'action' => 'edit')) );

Only bad thing is that you should add this for all your actions, otherwise not all routes succeed.
Another important note is that routes are matched in reverse order. Make sure your most generic routes are defined first, and more specific routes last.


Categories: General | PHP

Bart Online

One of my former classmates, Bart Dekeersmaeker, has just created his own blog. He will be posting news from Chennai, India, where he currently resides for work. He is outsourced to KBC, and they asked him to go to India. Good luck on your mission, Bart!

Categories: Personal | General

Microsoft and Zend collaborate on PHP for Windows

A nice press release today at Microsoft: Microsoft and Zend Technologies Announce Technical Collaboration to Improve Interoperability of PHP on the Windows Server Platform. Both companies admit that PHP is often developed on Windows systems, but the final server environment is mostly *nix. With this collaboration, Microsoft and Zend will try to change that.

The specific points of action in this collaboration:

  • Microsoft plans to releas an IIS add-on, FastCGI, that will serve as the interface between PHP and IIS. I talked about FastCGI earlier.
  • Zend will establish a Windows testing lab, to maintain high performance of PHP on Windows servers as PHP evolves.
  • Both parties will help to ensure a production-quality PHP environment for IIS 5.1 and newer versions
  • Both parties will provide support to the PHP community, helping developers planning to deploy PHP applications on Windows servers.

I think this is nice news! Looking forward to results of this collaboration...


Categories: General | PHP