Microsoft
Software
Hardware
Network
Question : Add function to Zend framework for global use
I would like to add this function for use in views and controllers everytime. Any body know who to add a function to Zend php?
public function prepareForUrl($item) {
// set and remove bad characters
$badChars = '#[^-a-zA-Z0-9_ ]#';
$item = preg_replace($badChars, '', $item);
$item = trim($item);
// change all dashed, underscores, spaces to dashes
$item = preg_replace('#[-_ ]+#', '-', $item);
return $item;
}
I've tried View Helpers but I get this error:
Plugin by name 'Prepareforurl' was not found in the registry;
Thanks for any help!
Answer : Add function to Zend framework for global use
The class name must be Zend_View_Helper_*, where * is the helper name itself. E.g., if you were writing a helper called "specialPurpose", the class name would be "Zend_View_Helper_SpecialP
urpose" (note the capitalization).
hope this helps
Random Solutions
Detect Simultaneous Logon Across Network
Cisco VPN Client 5.0.07.0290 on Windows 7 64 bit
DNS Problem on Adtran Netvanta 2100
memory
Solaris 10 zone fails to start up
Cisco 1310g Wireless Bridge, Fastethernet Hardware Status Down
Mcaffe EPO 4.5 : deploying new EPO with existing agents
Display User Pictures stored in AD (thumbnailPhoto) in Windows 7 and Windows 2008 Logins
Auto login Windows 7
Need to reinstall OS on a laptop