本文整理汇总了PHP中CMap::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CMap::__construct方法的具体用法?PHP CMap::__construct怎么用?PHP CMap::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMap
的用法示例。
在下文中一共展示了CMap::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
* @param mixed $data if string, it represents a config file (a PHP script returning the configuration as an array);
* If array, it is config data.
*/
public function __construct($data = null)
{
if (is_string($data)) {
parent::__construct(require $data);
} else {
parent::__construct($data);
}
}
示例2: __construct
/**
* Constructor.
* @param CForm the form object that owns this collection
* @param boolean whether this collection is used to store buttons.
*/
public function __construct($form, $forButtons = false)
{
parent::__construct();
$this->_form = $form;
$this->_forButtons = $forButtons;
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->init();
}
示例4: __construct
public function __construct(array $options)
{
parent::__construct($options);
}
示例5: __construct
/**
* @param Reflector $class
* @return CMap
*/
public function __construct($class)
{
$data = array('title' => NULL, 'description' => NULL);
if ($class instanceof Reflector && method_exists($class, 'getDocComment')) {
// Get the comment.
if (preg_match('#^/\\*\\*(.*)\\*/#s', $class->getDocComment(), $lines) !== false) {
$lines = trim($lines[1]);
// Get all the lines and strip the * from the first character.
if (preg_match_all('#^\\s*\\*(.*)#m', $lines, $lines) !== false) {
$description = array();
foreach ($lines[1] as $line) {
// Parse the line.
$line = trim($line);
if (!empty($line) && strpos($line, '@') === 0) {
// Get the parameter name and value.
$param = explode(' ', substr($line, 1), 2);
$data[$param[0]] = isset($param[1]) ? $param[1] : true;
} else {
if (count($data) <= 2) {
$description[] = $line;
// Store the first line in the title.
if (!empty($line) && empty($data['title'])) {
$data['title'] = $line;
}
}
}
// Store the line before params in the description.
$data['description'] = trim(implode(PHP_EOL, $description));
}
}
}
}
parent::__construct($data, true);
}