Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // file: library/Phpa/Controller/Action/Helper/FormfieldCounter.php
- class Phpa_Controller_Action_Helper_FormfieldCounter
- extends Zend_Controller_Action_Helper_Abstract
- {
- public function count($template)
- {
- $dom = new Zend_Dom_Query($template);
- $query = $dom->query('input[type="text"]');
- return count($query);
- }
- }
- public function newUserAction()
- {
- // action body
- $formfieldCounter = $this->_helper->getHelper('FormfieldCounter');
- $count = $formfieldCounter->count(
- $this->view->render('users/new-user.phtml'));
- $this->view->count = $count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement