本文整理汇总了PHP中Zend_Translate_Adapter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Translate_Adapter::__construct方法的具体用法?PHP Zend_Translate_Adapter::__construct怎么用?PHP Zend_Translate_Adapter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Translate_Adapter
的用法示例。
在下文中一共展示了Zend_Translate_Adapter::__construct方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Generates the adapter
*
* @param array $db The DB connection
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options OPTIONAL Options to set
*/
public function __construct($db, $locale = null, array $options = array())
{
// If $db is null: nothing to do.
if ($db == null) {
return;
}
// Keep the db reference for possible use
$this->db = $db;
// Check whether the view system is PHPLIB. In yes we
// add all the translations as entities in the view object
// Get the utilitary objects from the registry
$registry = Zend_registry::getInstance();
$zmax_context = $registry->get("zmax_context");
$config = $zmax_context->config;
// By default we take the zmax context view, unless it is explicitly given
if (isset($options['view'])) {
$this->phplib_view = $options['view'];
} else {
if ($config->view->zmax_view_system == "phplib") {
$this->phplib_view = $zmax_context->view;
}
}
// Now call the parent constructor
// Adding this option is necessary starting with Zend 1.6, to prevent
// an ugly message
$options['disableNotices'] = 'true';
parent::__construct($db, $locale, $options);
}
示例2: __construct
/**
* Generates the adapter
*
* @param string $data Translation data
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options Options for this adapter
*/
public function __construct($data, $locale = null, array $options = array())
{
$this->_options['delimiter'] = ";";
$this->_options['length'] = 0;
$this->_options['enclosure'] = '"';
parent::__construct($data, $locale, $options);
}
示例3: __construct
/**
* Generates the adapter
*
* @param array|Zend_Config $options Translation content
*/
public function __construct($options = array())
{
$this->_options['delimiter'] = ";";
$this->_options['length'] = 0;
$this->_options['enclosure'] = '"';
if ($options instanceof Zend_Config) {
$options = $options->toArray();
} else {
if (func_num_args() > 1) {
$args = func_get_args();
$options = array();
$options['content'] = array_shift($args);
if (!empty($args)) {
$options['locale'] = array_shift($args);
}
if (!empty($args)) {
$opt = array_shift($args);
$options = array_merge($opt, $options);
}
} else {
if (!is_array($options)) {
$options = array('content' => $options);
}
}
}
parent::__construct($options);
}
示例4: __construct
/**
* @param $locale
*/
public function __construct($locale)
{
if (!$locale instanceof \Zend_Locale) {
$locale = new \Zend_Locale($locale);
}
$locale = (string) $locale;
parent::__construct(array("locale" => $locale, "content" => array("__pimcore_dummy" => "only_a_dummy")));
}
示例5: __construct
/**
* @param array $options
* @return void
*/
public function __construct($options = array())
{
$options['scan'] = 'filename';
parent::__construct($options);
if (isset(self::$_cache)) {
$id = 'Zend_Translate_ListaMensagensTipo_' . $this->toString();
$temp = self::$_cache->load($id);
if ($temp) {
$this->_types = $temp;
}
}
}
示例6: __construct
/**
* Generates the adapter
*
* @param array $data Translation data
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options OPTIONAL Options to set
*/
public function __construct($data, $locale = null, array $options = array())
{
parent::__construct($data, $locale, $options);
}
示例7: __construct
/**
* Generates the adapter
*
* @param array $options Options for this adapter
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
*/
public function __construct($options, $locale = null)
{
parent::__construct($options, $locale);
}
示例8: __construct
/**
* Generates the adapter
*
* @param string $data Translation data
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options Options for this adapter
*/
public function __construct($data, $locale = null, array $options = array())
{
$this->_options['separator'] = ";";
$options = array_merge($this->_options, $options);
parent::__construct($data, $locale, $options);
}
示例9: __construct
/**
* Generates the adapter
*
* @param array $options - Options for this adapter
* @param string|Zend_Locale $language OPTIONAL Language to set, identical with locale identifier,
* see Zend_Locale for more information
*/
public function __construct($options, $language = null)
{
parent::__construct($options, $language);
}
示例10: __construct
/**
* Generates the adapter
*
* @param array|Zend_Config $options Translation content
*/
public function __construct($options = array()) {
$this->_options['keyDelimiter'] = ".";
parent::__construct($options);
}
示例11: __construct
/**
* Generates the adapter.
*
* Convert some PHProject lang shortname to the Zend locale names.
*
* @param string $data Path to the default lang file.
* @param string $locale PHProjekt locale string.
*
* @return void
*/
public function __construct($data, $locale = 'en')
{
$locale = self::_convertToZendLocale($locale);
parent::__construct($data, $locale, array('disableNotices' => true));
}
示例12: __construct
/**
* Generates the adapter.
*
* Convert some PHProject lang shortname to the Zend locale names.
*
* @param string $data Path to the default lang file.
* @param string $locale PHProjekt locale string.
*
* @return void
*/
public function __construct($options)
{
$options['locale'] = self::_convertToZendLocale($options['locale']);
$options['disableNotices'] = true;
parent::__construct($options);
}