Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复临时关闭布局的用法,导致返回template对象的问题; #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
/vendor
/composer.lock
13 changes: 13 additions & 0 deletions src/Think.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,19 @@ public function getConfig(string $name)
return $this->template->getConfig($name);
}

/**
* 设置布局
* @access public
* @param bool|string $name 布局模板名称 false 则关闭布局
* @param string $replace 布局模板内容替换标识
* @return $this
*/
public function layout(bool|string $name, string $replace = '')
{
$this->template->layout($name, $replace);
return $this;
}

public function __call($method, $params)
{
return call_user_func_array([$this->template, $method], $params);
Expand Down