web/lib/Zend/Controller/Action/Helper/Abstract.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Controller
    16  * @package    Zend_Controller
    17  * @subpackage Zend_Controller_Action_Helper
    17  * @subpackage Zend_Controller_Action_Helper
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Abstract.php 20261 2010-01-13 18:55:25Z matthew $
    20  * @version    $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Controller_Action
    24  * @see Zend_Controller_Action
    25  */
    25  */
    27 
    27 
    28 /**
    28 /**
    29  * @category   Zend
    29  * @category   Zend
    30  * @package    Zend_Controller
    30  * @package    Zend_Controller
    31  * @subpackage Zend_Controller_Action_Helper
    31  * @subpackage Zend_Controller_Action_Helper
    32  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    33  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    34  */
    34  */
    35 abstract class Zend_Controller_Action_Helper_Abstract
    35 abstract class Zend_Controller_Action_Helper_Abstract
    36 {
    36 {
    37     /**
    37     /**
   140      *
   140      *
   141      * @return string
   141      * @return string
   142      */
   142      */
   143     public function getName()
   143     public function getName()
   144     {
   144     {
   145         $full_class_name = get_class($this);
   145         $fullClassName = get_class($this);
   146 
   146         if (strpos($fullClassName, '_') !== false) {
   147         if (strpos($full_class_name, '_') !== false) {
   147             $helperName = strrchr($fullClassName, '_');
   148             $helper_name = strrchr($full_class_name, '_');
   148             return ltrim($helperName, '_');
   149             return ltrim($helper_name, '_');
   149         } elseif (strpos($fullClassName, '\\') !== false) {
       
   150             $helperName = strrchr($fullClassName, '\\');
       
   151             return ltrim($helperName, '\\');
   150         } else {
   152         } else {
   151             return $full_class_name;
   153             return $fullClassName;
   152         }
   154         }
   153     }
   155     }
   154 }
   156 }