本文整理汇总了PHP中Zend_Validate::addDefaultNamespaces方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Validate::addDefaultNamespaces方法的具体用法?PHP Zend_Validate::addDefaultNamespaces怎么用?PHP Zend_Validate::addDefaultNamespaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Validate
的用法示例。
在下文中一共展示了Zend_Validate::addDefaultNamespaces方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct() {
$this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' );
Zend_Registry::set('config', $this->bootstrap->getOptions());
$config = Zend_Registry::get('config');
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
//Zend_Loader::loadClass('Base_Controller_Action_Helper_Messenger_Abstract');
Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']);
Zend_Validate::addDefaultNamespaces('Base_Form_Validate');
}
示例2: init
/**
* Defined by Zend_Application_Resource_Resource
*
* @return Zend_View
*/
public function init()
{
// locale Options
$language = null;
if (Zend_Registry::isRegistered("Zend_Locale")) {
$locale = Zend_Registry::get("Zend_Locale");
$language = $locale->getLanguage() . "_" . $locale->getRegion();
}
$options = $this->getOptions();
if (!is_null($language) and isset($options["translate"])) {
$options["translate"]["locale"] = $language;
$translator = new Zend_Translate($options["translate"]);
Zend_Validate_Abstract::setDefaultTranslator($translator);
}
Zend_Validate::addDefaultNamespaces('ZLayer_Validate');
}
示例3: testNamespaces
/**
* Testing Namespaces
*
* @return void
*/
public function testNamespaces()
{
$this->assertEquals(array(), Zend_Validate::getDefaultNamespaces());
$this->assertFalse(Zend_Validate::hasDefaultNamespaces());
Zend_Validate::setDefaultNamespaces('TestDir');
$this->assertEquals(array('TestDir'), Zend_Validate::getDefaultNamespaces());
Zend_Validate::setDefaultNamespaces('OtherTestDir');
$this->assertEquals(array('OtherTestDir'), Zend_Validate::getDefaultNamespaces());
$this->assertTrue(Zend_Validate::hasDefaultNamespaces());
Zend_Validate::setDefaultNamespaces(array());
$this->assertEquals(array(), Zend_Validate::getDefaultNamespaces());
$this->assertFalse(Zend_Validate::hasDefaultNamespaces());
Zend_Validate::addDefaultNamespaces(array('One', 'Two'));
$this->assertEquals(array('One', 'Two'), Zend_Validate::getDefaultNamespaces());
Zend_Validate::addDefaultNamespaces('Three');
$this->assertEquals(array('One', 'Two', 'Three'), Zend_Validate::getDefaultNamespaces());
Zend_Validate::setDefaultNamespaces(array());
}
示例4: _initValidationNamespaces
public function _initValidationNamespaces()
{
Zend_Validate::addDefaultNamespaces('Form_Validate');
}