AdminBar.php
1 month ago
AdminBarEditColumns.php
1 month ago
Colors.php
1 month ago
CommonAssets.php
1 month ago
CurrentTable.php
1 month ago
ManageHeadings.php
1 month ago
ManageValue.php
1 month ago
NoticeChecks.php
1 month ago
PluginUpdate.php
1 month ago
PromoChecks.php
1 month ago
QuickEdit.php
1 month ago
SaveHeadings.php
1 month ago
Setup.php
1 month ago
TableRows.php
1 month ago
Tooltips.php
1 month ago
View.php
1 month ago
View.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Service; |
| 4 | |
| 5 | use AC\Asset\Location; |
| 6 | use AC\Registerable; |
| 7 | |
| 8 | class View implements Registerable |
| 9 | { |
| 10 | |
| 11 | private Location $location; |
| 12 | |
| 13 | public function __construct(Location $location) |
| 14 | { |
| 15 | $this->location = $location; |
| 16 | } |
| 17 | |
| 18 | public function register(): void |
| 19 | { |
| 20 | add_filter('ac/view/templates', [$this, 'templates']); |
| 21 | } |
| 22 | |
| 23 | public function templates(array $templates): array |
| 24 | { |
| 25 | $templates[] = $this->location->with_suffix('templates')->get_path(); |
| 26 | |
| 27 | return $templates; |
| 28 | } |
| 29 | |
| 30 | } |