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
WatchGuard XTM Web UI
Exchange 2010 Antivirus Options
added a function to webservice. Why can't i see it by intellesense on the client
Mac OS X 10.6.3 Can't logon to Active directory
T SQL Query and Dates
Insert Script from the command prompt
Exchange 2010 resource mailbox for meeting room
Setting Folder Permission in Windows XP - VB Script
Install SQL reporting services 2005 and 2008 on the same server
How do I add rows to a datagridview based upon a For Each statement in VS2008?