Lines Matching refs:Snippet

23  * Class Snippet
32 * A snippet identifier is a {@link Snippet::getLocalUrl() local file}
33 * * if there is content defined, it will be an {@link Snippet::hasInlineContent() inline}
34 * * if not, it will be the local file with the {@link Snippet::getLocalUrl()}
35 * * if not found or if the usage of the cdn is required, the {@link Snippet::getRemoteUrl() url} is used
38 class Snippet implements JsonSerializable
134 * A special slot exists for {@link Snippet::REQUEST_SCOPE}
142 * * or {@link Snippet::REQUEST_SCOPE} - never cached
155 * (ie with a to function such as {@link Snippet::toTagAttributes()} or {@link Snippet::toDokuWikiArray()}
167 * use {@link Snippet::getOrCreateFromContext()}
178 public static function createCssSnippetFromComponentId($componentId): Snippet
180 return Snippet::createSnippetFromComponentId($componentId, self::EXTENSION_CSS);
186 public static function createSnippetFromComponentId($componentId, $type): Snippet
189 return Snippet::createSnippetFromPath($path)
198 * @param string $extension - {@link Snippet::EXTENSION_CSS css} or {@link Snippet::EXTENSION_JS js}
199 * @return Snippet
201 public static function getOrCreateFromComponentId(string $componentId, string $extension): Snippet
220 * @return Snippet[]
235 * @return Snippet
237 public static function createSnippet(Path $path): Snippet
239 return new Snippet($path);
246 * See also {@link Snippet::getClass()} function
256 public static function createSnippetFromPath(WikiPath $path): Snippet
258 return new Snippet($path);
264 * but if it's, it permits to work without any connection by setting the {@link Snippet::CONF_USE_CDN cdn} to off
265 * @return Snippet
267 public static function getOrCreateFromContext(Path $localSnippetPath): Snippet
335 $snippet->addElement(Snippet::REQUEST_SCOPE);
347 public static function createComboSnippet(string $wikiPath): Snippet
355 * @return Snippet
359 public static function getOrCreateFromLibraryNamespace(string $wikiPath): Snippet
369 * should create the snippet via the {@link Snippet::getOrCreateFromLibraryNamespace() local path}
370 * and set {@link Snippet::setRemoteUrl() remote url}
374 public static function getOrCreateFromRemoteUrl(Url $url): Snippet
386 $localPath = WikiPath::createComboResource(Snippet::LIBRARY_BASE . ":$libraryName");
402 public static function createJavascriptSnippetFromComponentId(string $componentId): Snippet
404 return Snippet::createSnippetFromComponentId($componentId, self::EXTENSION_JS);
410 * @return Snippet for chaining
422 * The value is stored in the {@link Snippet::getCritical()}
424 public function setCritical($bool): Snippet
436 public function setDoesManipulateTheDomOnRun($bool): Snippet
444 * @return Snippet for chaining
446 public function setInlineContent($inlineContent): Snippet
579 public static function createFromJson($array): Snippet
588 $snippet = Snippet::getOrCreateFromContext($wikiPath);
641 public function setIntegrity(?string $integrity): Snippet
650 public function addHtmlAttribute(string $name, string $value): Snippet
656 public function addElement(string $element): Snippet
872 if ($this->getExtension() === Snippet::EXTENSION_JS) {
937 case Snippet::EXTENSION_JS:
939 case Snippet::EXTENSION_CSS:
941 return Snippet::STYLE_TAG;
943 return Snippet::LINK_TAG;
952 public function setComponentId(string $componentId): Snippet
958 public function setRemoteUrl(Url $url): Snippet
993 case Snippet::EXTENSION_JS:
1034 case Snippet::EXTENSION_CSS:
1088 * @return bool - yes if the function {@link Snippet::toTagAttributes()}
1089 * or {@link Snippet::toDokuWikiArray()} has been called
1168 * @return Snippet
1170 public function setFormat(string $format): Snippet