Skip to content

Commit

Permalink
feat: add toggle endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
64knl committed Apr 14, 2023
1 parent d5f9158 commit df530b4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/NotFound/Layout/Elements/Table/LayoutTableColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace NotFound\Layout\Elements\Table;

use stdClass;

/**
* LayoutTableColumn
*
Expand All @@ -12,11 +14,21 @@ class LayoutTableColumn
public function __construct(
public string $value,
public string $type = 'text',
public object $properties = new \stdClass(),
public object $properties = new stdClass()
) {
return $this;
}

public function setToggleEndPoint( string $url ) : self
{
if( $this->type !== 'checkbox')
{
throw new \Exception('Can only set toggle endpoint on checkbox type');
}
$this->properties->toggleEndPoint = $url;
return $this;
}

public function makeLinkButton(string $to, $external = false): self
{
$this->type = 'InputButton';
Expand Down

0 comments on commit df530b4

Please sign in to comment.