Skip to content
Permalink
Browse files

ID#323: introduced type hinting.

  • Loading branch information...
Christian Achatz
Christian Achatz committed Jun 30, 2018
1 parent c891a5f commit 917d37fccb75409a838d3b13199ad977e070e447
@@ -36,15 +36,15 @@ class DynamicCssNode extends HtmlNode implements CssNode {
* @param string $url Optional url.
* @param string $namespace Namespace of file
* @param string $filename Name of file (without .css)
* @param bool $fcaction Optional. Create link for FC-Action.
* @param bool $fcAction Optional. Create link for FC-Action.
* @param string $media Optional css media definition (e.g. "print", "screen", or any other media query).
*/
public function __construct($url, $namespace, $filename, $fcaction = true, $media = null) {
public function __construct($url, $namespace, $filename, $fcAction = true, $media = null) {
$this->setAttribute('href', $this->buildFrontControllerLink(
$url,
$namespace,
$filename,
$fcaction,
$fcAction,
'css'
));
$this->setAttribute('rel', 'stylesheet');
@@ -36,14 +36,14 @@ class DynamicJsNode extends HtmlNode implements JsNode {
* @param string $url Optional url.
* @param string $namespace Namespace of file
* @param string $filename Name of file (without .js)
* @param bool $fcaction Optional. Create link for FC-Action.
* @param bool $fcAction Optional. Create link for FC-Action.
*/
public function __construct($url, $namespace, $filename, $fcaction = null) {
public function __construct($url, $namespace, $filename, $fcAction = null) {
$this->setAttribute('src', $this->buildFrontControllerLink(
$url,
$namespace,
$filename,
$fcaction,
$fcAction,
'js'
));
$this->setAttribute('type', 'text/javascript');
@@ -103,18 +103,18 @@ public function transform() {
* @param string $url Optional url.
* @param string $namespace Namespace of file
* @param string $filename Name of file
* @param bool $fcaction Optional. Create link for FC-Action.
* @param bool $fcAction Optional. Create link for FC-Action.
* @param string $type Filetype
*
* @return string elements' link.
*/
protected function buildFrontControllerLink($url, $namespace, $filename, $fcaction, $type) {
protected function buildFrontControllerLink($url, $namespace, $filename, $fcAction, $type) {
if ($fcaction === null) {
$fcaction = true;
if ($fcAction === null) {
$fcAction = true;
}
if ($fcaction) {
if ($fcAction) {
$UrlObj = ($url === null) ? Url::fromCurrent(true) : Url::fromString($url);
return LinkGenerator::generateActionUrl($UrlObj, 'APF\extensions\htmlheader', 'JsCss', [

0 comments on commit 917d37f

Please sign in to comment.
You can’t perform that action at this time.