News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Evert Pot's Blog:
Taking advantage of PHP namespaces with older code
February 01, 2011 @ 10:10:35

Evert Pot has a quick post about a suggestion mentioned at PHPBenelux related to using namespaces with older code.

If you're running PHP 5.3 and you have to use pesky old code that uses long class prefixes (yea, so, pretty much all PHP code out there), you can still make use of namespace features to shorten them.

He includes a quick example that shows the shift from using the traditional Zend_Controller_Action_Helper_AutoComplete_Abstract to an aliasing with the use/as to just reference it as AutoComplete.

0 comments voice your opinion now!
namespace old code zendframework use keyword


blog comments powered by Disqus

Similar Posts

Travis Swicegood's Blog: Quick review of Zend_Log

Mihai Corlan's Blog: Debugging Flex and PHP

Codeacy Blog: Your Greatest Code Quality Threats and How to Solve Them

Matthew Turland's Blog: Zend Framework and Remember The Milk

Padraic Brady's Blog: Self-Contained Reusable Zend Framework Modules With Standardised Configurators


Community Events





Don't see your event here?
Let us know!


interview threedevsandamaybe configure symfony2 developer install podcast code release list refactor opinion community series testing language introduction unittest framework laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework