nur-sery/nur_src/v/base/TComponentPrintable.php

40 lines
639 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur\v\base;
use nur\A;
trait TComponentPrintable {
function haveJquery(): bool {
return static::HAVE_JQUERY;
}
function printJquery(): void {
?>
<script type="text/javascript">
jQuery.noConflict()(function($) {
});
</script>
<?php
}
function haveScript(): bool {
return static::HAVE_SCRIPT;
}
function printScript(): void {
?>
<script type="text/javascript">
</script>
<?php
}
function prepare(): void {
$plugins = static::PLUGINS;
if ($plugins !== null) {
foreach (A::with($plugins) as $name => $plugin) {
$this->addPlugin($plugin, $name);
}
}
}
}