-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added ability to provide custom options for each banner through Renderer or Latte macro - added support for native lazy loading - updated default templates due to implementation of custom banner options and native lazy loading - added and fixed tests - updated docs - updated CHANGELOG
- Loading branch information
Showing
47 changed files
with
616 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SixtyEightPublishers\AmpClient\Renderer\Latte; | ||
|
||
use SixtyEightPublishers\AmpClient\Request\ValueObject\Position as RequestPosition; | ||
|
||
final class Helpers | ||
{ | ||
private function __construct() {} | ||
|
||
/** | ||
* @return array<string, string> | ||
*/ | ||
public static function createResourceAttributes(RequestPosition $position): array | ||
{ | ||
$attributes = []; | ||
|
||
foreach ($position->getResources() as $resource) { | ||
$attributes['data-amp-resource-' . $resource->getCode()] = implode(',', $resource->getValues()); | ||
} | ||
|
||
return $attributes; | ||
} | ||
|
||
/** | ||
* @param array<string, scalar> $options | ||
* | ||
* @return array<string, scalar> | ||
*/ | ||
public static function createOptionAttributes(array $options): array | ||
{ | ||
$attributes = []; | ||
|
||
foreach ($options as $name => $value) { | ||
$attributes['data-amp-option-' . $name] = $value; | ||
} | ||
|
||
return $attributes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.