Skip to content

Commit 917abe1

Browse files
committed
Add class LINEMSG_FlexContainer
1 parent 7439b12 commit 917abe1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

api.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,43 @@ public function out(){
578578
}
579579

580580
class LINEMSG_FlexContainer {
581+
public function __construct($container){
582+
switch($container){
583+
case "bubble":
584+
$this->object = array(
585+
"type" => "bubble",
586+
"direction" => null,
587+
"header" => null,
588+
"hero" => null,
589+
"body" => null,
590+
"footer" => null,
591+
"styles" => null
592+
);
593+
break;
594+
case "carousel":
595+
$this->object = array(
596+
"type" => "carousel",
597+
"contents" => null,
598+
);
599+
break;
600+
default:
601+
return null;
602+
}
603+
}
604+
605+
public function set($var, $value = null){
606+
if(gettype($var) == "array"){
607+
$keys = array_keys($this->object);
608+
foreach($var as $num => $run){
609+
$this->set($keys[$num+1], $run);
610+
}
611+
}else{
612+
$this->object[$var] = $value;
613+
}
614+
}
581615

616+
public function out(){
617+
return $this->object;
618+
}
582619
}
583620
?>

0 commit comments

Comments
 (0)