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
Suggestions for Cicso NM modules for LRE setup
windows 7 home password policy
Making a movie project into a DVD file in Windows 7. How do I burn copies in Vista?
How do I have a field displayed in a report for all data options except one
Upgrade Exchange SP2 to SP3
3d barcodes (q-codes)
Installing PHP XP (IIS 5.1)
Visual Basic.Net Question on Checking a field if Numeric Data entered
Exchange 2010 on Windows Server Enterprise 2008 SP2 Locking Up
SQL Statement. Copy and paste characters from cell into another in same record