Properly implemented OG
This commit is contained in:
parent
ee6e8b0593
commit
215f984fe4
16 changed files with 87 additions and 50 deletions
|
|
@ -1,16 +1,19 @@
|
|||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Full;
|
||||
use TikScraper\Models\Feed;
|
||||
use TikScraper\Models\Info;
|
||||
|
||||
/**
|
||||
* Base for templates with both info and feed
|
||||
*/
|
||||
class FullTemplate extends BaseTemplate {
|
||||
public Full $data;
|
||||
public Info $info;
|
||||
public Feed $feed;
|
||||
|
||||
function __construct(string $title, Full $data) {
|
||||
function __construct(string $title, Info $info, Feed $feed) {
|
||||
parent::__construct($title);
|
||||
$this->data = $data;
|
||||
$this->info = $info;
|
||||
$this->feed = $feed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Info;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class VideoTemplate extends BaseTemplate {
|
||||
public object $item;
|
||||
public object $detail;
|
||||
public Info $info;
|
||||
public string $layout = 'hero';
|
||||
|
||||
function __construct(object $item, object $detail, bool $isEmbed = false) {
|
||||
function __construct(object $item, Info $info, bool $isEmbed = false) {
|
||||
parent::__construct('Video');
|
||||
$this->item = $item;
|
||||
$this->detail = $detail;
|
||||
$this->info = $info;
|
||||
if ($isEmbed) {
|
||||
$this->layout = 'embed';
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue