Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
- {
- /*
- * The directory I am pointing to is in library/Helpers
- * slides did not explain the importance or puprose of function
- * name when using the init here so I guessed as I could find
- * nothing about it online.
- */
- public function _initCountFields()
- {
- //slides did not explain if this path was retaive to root, application or what so after
- //spending about 20 mins online I think I have it correct
- Zend_Controller_Action_HelperBroker::addPrefix('Helpers');
- }
- }
- //action
- public function adduserAction()
- {
- //call the CountFileds helper and count fields
- $helper = $this->_helper->CountFields;
- $helper->countFormFields();
- }
- //class (helper)
- /*
- * slides did not explain id the class name needed to be prefixed with folder name
- * so in this example Helpers_CountFields??? looked online
- * but again different versions of zend out there doing it
- * different ways and the manual pages are a bit crap in this regard.
- */
- Class CountFields extends Zend_Controller_Action_Helper_Abstract
- {
- /*
- * Could not get function to work and after about 2 hours of messing around
- * left it otherwise my weekend would be gone.
- */
- public function countFormFields()
- {
- //this is where we would put the code to count form fields...
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement