class JcarouselAppendCommand in jCarousel 8.4
Same name and namespace in other branches
- 8.5 src/Ajax/JcarouselAppendCommand.php \Drupal\jcarousel\Ajax\JcarouselAppendCommand
An AJAX command for adding jCarousel items dynamically.
This command is implemented by Drupal.AjaxCommands.prototype.jcarousel_append() defined in jcarousel/assets/vendor/jcarousel/jcarousel.js.
Hierarchy
- class \Drupal\jcarousel\Ajax\JcarouselAppendCommand implements CommandInterface, CommandWithAttachedAssetsInterface uses CommandWithAttachedAssetsTrait
Expanded class hierarchy of JcarouselAppendCommand
See also
http://sorgalla.com/jcarousel/docs/reference/usage.html#manipulating-the...
1 file declares its use of JcarouselAppendCommand
- JcarouselViewAjaxController.php in src/
Controller/ JcarouselViewAjaxController.php - Contains \Drupal\jcarousel\Controller\JcarouselViewAjaxController.
File
- src/
Ajax/ JcarouselAppendCommand.php, line 23 - Contains \Drupal\Core\Ajax\JcarouselAppendCommand.
Namespace
Drupal\jcarousel\AjaxView source
class JcarouselAppendCommand implements CommandInterface, CommandWithAttachedAssetsInterface {
use CommandWithAttachedAssetsTrait;
/**
* A CSS selector string.
*
* If the command is a response to a request from an #ajax form element then
* this value can be NULL.
*
* @var string
*/
protected $selector;
/**
* The content for the matched element(s).
*
* Either a render array or an HTML string.
*
* @var string|array
*/
protected $content;
/**
* A settings array to be passed to any any attached JavaScript behavior.
*
* @var array
*/
protected $settings;
/**
* Preload content flag.
*
* If the command is a response to a request from an #ajax form element then
* this value can be NULL.
*
* @var bool
*/
protected $stop_preload;
/**
* {@inheritdoc}
*/
public function __construct($selector, $content, array $settings = NULL) {
$this->selector = $selector;
$this->content = $content;
$this->settings = $settings;
}
/**
* {@inheritdoc}
*/
public function render() {
return array(
'command' => 'jcarousel_append',
'method' => 'append',
'selector' => $this->selector,
'data' => $this
->getRenderedContent(),
'settings' => $this->settings,
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommandWithAttachedAssetsTrait:: |
protected | property | The attached assets for this Ajax command. | |
CommandWithAttachedAssetsTrait:: |
public | function | Gets the attached assets. | |
CommandWithAttachedAssetsTrait:: |
protected | function | Processes the content for output. | |
JcarouselAppendCommand:: |
protected | property | The content for the matched element(s). | |
JcarouselAppendCommand:: |
protected | property | A CSS selector string. | |
JcarouselAppendCommand:: |
protected | property | A settings array to be passed to any any attached JavaScript behavior. | |
JcarouselAppendCommand:: |
protected | property | Preload content flag. | |
JcarouselAppendCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
JcarouselAppendCommand:: |
public | function |