Horde_Core_Block::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string $app, array | boolean $params = [] )
$app string The application name.
$params array | boolean Any parameters the block needs. If false, the default parameter will be used.
    public function __construct($app, $params = array())
    {
        $this->_app = $app;
        // @todo: we can't simply merge the default values and stored values
        // because empty parameter values are not stored at all, so they would
        // always be overwritten by the defaults.
        if ($params === false) {
            foreach ($this->getParams() as $name => $param) {
                $this->_params[$name] = $param['default'];
            }
        } else {
            $this->_params = $params;
        }
    }

Usage Example

示例#1
0
 /**
  */
 public function __construct($app, $params = array())
 {
     parent::__construct($app, $params);
     foreach (Turba::getAddressBooks(Horde_Perms::READ) as $key => $addressbook) {
         $this->_options[$key] = $addressbook['title'];
     }
     $this->_name = _("Contact Search");
 }
All Usage Examples Of Horde_Core_Block::__construct