1 | <?php |
||
20 | abstract class Assets |
||
21 | { |
||
22 | abstract public function developmentAssets() : void; |
||
23 | |||
24 | abstract public function productionAssets() : void; |
||
25 | |||
26 | abstract public function adminAssets() : void; |
||
27 | |||
28 | public function __construct() |
||
36 | |||
37 | protected function addScript( |
||
53 | |||
54 | protected function addStylesheet( |
||
65 | |||
66 | /* |
||
67 | * Usage example with name="subscribe" and ajaxUrl="subscribeAjax": |
||
68 | * |
||
69 | * // subscribe.js |
||
70 | * |
||
71 | * $.ajax({ |
||
72 | * url: subscribeAjax.ajaxUrl, |
||
73 | * method: 'GET', |
||
74 | * data: { |
||
75 | * action: 'ajax-action-registered-in-your-php-file', |
||
76 | * } |
||
77 | * }).done(function (response) { |
||
78 | * (...) |
||
79 | * }); |
||
80 | */ |
||
81 | protected function registerAjaxUrls(string $name, string $ajaxUrl) : void |
||
92 | |||
93 | private function path(string $from, string $name, string $fileType = 'js') : string |
||
97 | } |
||
98 |