本文整理匯總了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');
}