Skip to content

Commit

Permalink
添加资源目录 方法更新,新增参数isDefault,可设定是否为默认目录
Browse files Browse the repository at this point in the history
  • Loading branch information
itxq committed Dec 26, 2018
1 parent 7321671 commit de53b72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CkFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ protected function __construct($config = []) {
* @param string $name - 显示名称
* @param string $directory - 目录路径
* @param string $backend - 所属存储空间
* @param bool $isDefault - 是否为默认目录
* @param array $config - 更多配置
* @return CkFinder
*/
public function addResource($name, $directory, $backend, $config = []) {
public function addResource($name, $directory, $backend, $isDefault = false, $config = []) {
$config['name'] = $name;
$config['directory'] = $directory;
$config['backend'] = $backend;
$this->config['resourceTypes'][] = $config;
if ($isDefault) {
$this->setConfig('defaultResourceTypes', $name);
}
return $this;
}

Expand Down

0 comments on commit de53b72

Please sign in to comment.