本文整理汇总了PHP中Answer::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::__construct方法的具体用法?PHP Answer::__construct怎么用?PHP Answer::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Answer
的用法示例。
在下文中一共展示了Answer::__construct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Registry $Registry, array $a = null)
{
/**
* 3 Lines below to change the database
* that's going to be used to the test database
*
* This in theory is not necessary because boostrap.php
* is used in all tests and it defines MONGO_DBNAME as LAMPCMS_TEST
* but this is just an extra precaution
*/
$aMongo = $Registry->Ini->getSection('MONGO');
$aMongo['db'] = 'LAMPCMS_TEST';
$Registry->Ini->setSection('MONGO', $aMongo);
$a = \json_decode($this->JSON_ENCODED, true);
parent::__construct($Registry, $a);
}
示例2: __construct
public function __construct($construct_params)
{
parent::__construct($construct_params);
if (empty($this->options)) {
add_message('You must provide options for a dropdown answer', 'danger');
}
if (empty($this->ajax_callback)) {
add_message('You must provide an AJAX callback for a dropdown answer', 'danger');
}
}