"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/views/src/Plugin/views/argument/WeekDate.php" (26 Nov 2020, 430 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "WeekDate.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 9.0.9_vs_9.1.0.

    1 <?php
    2 
    3 namespace Drupal\views\Plugin\views\argument;
    4 
    5 /**
    6  * Argument handler for a week.
    7  *
    8  * @ViewsArgument("date_week")
    9  */
   10 class WeekDate extends Date {
   11 
   12   /**
   13    * {@inheritdoc}
   14    */
   15   protected $argFormat = 'W';
   16 
   17   /**
   18    * Provide a link to the next level of the view
   19    */
   20   public function summaryName($data) {
   21     $created = $data->{$this->name_alias};
   22     return $this->t('Week @week', ['@week' => $created]);
   23   }
   24 
   25 }