class FormsDataCollector in Devel 8.2
Same name and namespace in other branches
- 8.3 webprofiler/src/DataCollector/FormsDataCollector.php \Drupal\webprofiler\DataCollector\FormsDataCollector
- 8 webprofiler/src/DataCollector/FormsDataCollector.php \Drupal\webprofiler\DataCollector\FormsDataCollector
- 4.x webprofiler/src/DataCollector/FormsDataCollector.php \Drupal\webprofiler\DataCollector\FormsDataCollector
Class FormsDataCollector
Hierarchy
- class \Drupal\webprofiler\DataCollector\FormsDataCollector extends \Symfony\Component\HttpKernel\DataCollector\DataCollector implements DrupalDataCollectorInterface uses StringTranslationTrait
Expanded class hierarchy of FormsDataCollector
1 string reference to 'FormsDataCollector'
- webprofiler.services.yml in webprofiler/
webprofiler.services.yml - webprofiler/webprofiler.services.yml
1 service uses FormsDataCollector
File
- webprofiler/
src/ DataCollector/ FormsDataCollector.php, line 16
Namespace
Drupal\webprofiler\DataCollectorView source
class FormsDataCollector extends DataCollector implements DrupalDataCollectorInterface {
use StringTranslationTrait, DrupalDataCollectorTrait;
/**
* @var \Drupal\Core\Form\FormBuilderInterface
*/
private $formBuilder;
/**
* @param \Drupal\Core\Form\FormBuilderInterface $formBuilder
*/
public function __construct(FormBuilderInterface $formBuilder) {
$this->formBuilder = $formBuilder;
$this->data['forms'] = [];
}
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$this->data['forms'] = [];
if ($this->formBuilder instanceof FormBuilderWrapper) {
$this->data['forms'] = $this->formBuilder
->getBuildForm();
}
}
/**
* @return array
*/
public function getForms() {
return !empty($this->data['forms']) && is_array($this->data['forms']) ? $this->data['forms'] : [];
}
/**
* @return int
*/
public function getFormsCount() {
return count($this
->getForms());
}
/**
* {@inheritdoc}
*/
public function getName() {
return 'forms';
}
/**
* {@inheritdoc}
*/
public function getTitle() {
return $this
->t('Forms');
}
/**
* {@inheritdoc}
*/
public function getPanelSummary() {
return $this
->t('Rendered: @forms', [
'@forms' => $this
->getFormsCount(),
]);
}
/**
* {@inheritdoc}
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ZGlkOjRGQTVBQzVBOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+I7130QAAAKRJREFUeNrsVVsKxCAMzIgH8897eDHxGP55LX+0RmjpYxHdyrLsNl9iknEyExA5Z5oZgibH9wPKVlJrnVNKRwZCkPceQ4AhhOpUjJFaeaXUBRjssrW2FvDZGINS2GV9AQb3rpvCvZWhc24rKpdDmp17P2MKjzIFEAD16vdDi73Xbx2/pelZItnz6oiusneB32b4is0Iw8eUfzBlOiCef/l2LAIMAGACWQCJ5bXFAAAAAElFTkSuQmCC';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalDataCollectorInterface:: |
public | function | 8 | |
DrupalDataCollectorInterface:: |
public | function | 1 | |
DrupalDataCollectorInterface:: |
public | function | Returns the libraries needed in detail panel. | 2 |
DrupalDataCollectorInterface:: |
public | function | Returns true if this datacollector has a detail panel. | 2 |
FormsDataCollector:: |
private | property | ||
FormsDataCollector:: |
public | function | Collects data for the given Request and Response. | |
FormsDataCollector:: |
public | function | ||
FormsDataCollector:: |
public | function | ||
FormsDataCollector:: |
public | function |
Returns the collector icon in base64 format. Overrides DrupalDataCollectorInterface:: |
|
FormsDataCollector:: |
public | function |
Returns the name of the collector. Overrides DrupalDataCollectorInterface:: |
|
FormsDataCollector:: |
public | function |
Returns the string used in vertical tab summary. Overrides DrupalDataCollectorInterface:: |
|
FormsDataCollector:: |
public | function |
Returns the datacollector title. Overrides DrupalDataCollectorInterface:: |
|
FormsDataCollector:: |
public | function | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |