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
Exchange Down, MSExchangeAL 8231, FSMO Error 1355 All GC's Down
which is the best website to learn stored procedure ??
SSG5 VPN Routing, internal LAN route works, VPN route doesnt.
How do I find the .NET FW version on 64 bit Windows 7? XP?
Best Website to Collect Photos
Pass URL Parameter to multiple iFrames in ASP
Google Chart corechart help
Cisco 2950 Vlan for Voice
How do I charge for a job?
Symantec Endpoint Protection - SID 23615 HTTPS Tidserv Request 2 Detected