Skip to content

Commit 0d8d656

Browse files
author
Tom Hanoldt
committed
add mechanism for default assets
1 parent cba9074 commit 0d8d656

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Assets.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ public function expand($uri){
2626
}
2727

2828

29-
private $published = false;
30-
3129
// for detecting whether to load default assets or not
30+
private $published = false;
3231
public function published($set=null){
3332
if($set === null)
3433
return $this->published;
@@ -37,4 +36,17 @@ public function published($set=null){
3736

3837
return $this;
3938
}
39+
40+
protected $defaultCallable;
41+
public function setDefault($callable){
42+
$this->defaultCallable = $callable;
43+
}
44+
45+
public function publishDefault(){
46+
if(!is_callable($this->defaultCallable))
47+
return ;
48+
49+
$tmp = $this->defaultCallable;
50+
$tmp($this);
51+
}
4052
}

0 commit comments

Comments
 (0)