2626 * <?= Carousel::widget()
2727 * ->id('carouselExample')
2828 * ->items(
29- * CarouselItem::to(Img::tag( )->alt('First slide')->src('image-1.jpg'), active: true),
30- * CarouselItem::to(Img::tag( )->alt('Second slide')->src('image-2.jpg')),
31- * CarouselItem::to(Img::tag( )->alt('Third slide')->src('image-3.jpg')),
29+ * CarouselItem::to((new Img() )->alt('First slide')->src('image-1.jpg'), active: true),
30+ * CarouselItem::to((new Img() )->alt('Second slide')->src('image-2.jpg')),
31+ * CarouselItem::to((new Img() )->alt('Third slide')->src('image-3.jpg')),
3232 * )
3333 * ?>
3434 * ```
@@ -409,9 +409,9 @@ public function id(bool|string $id): self
409409 * Example usage:
410410 * ```php
411411 * $carousel->items(
412- * CarouselItem::to(Img::tag( )->alt('First slide')->src('image-1.jpg'), active: true),
413- * CarouselItem::to(Img::tag( )->alt('Second slide')->src('image-2.jpg')),
414- * CarouselItem::to(Img::tag( )->alt('Third slide')->src('image-3.jpg')),
412+ * CarouselItem::to((new Img() )->alt('First slide')->src('image-1.jpg'), active: true),
413+ * CarouselItem::to((new Img() )->alt('Second slide')->src('image-2.jpg')),
414+ * CarouselItem::to((new Img() )->alt('Third slide')->src('image-3.jpg')),
415415 * );
416416 */
417417 public function items (CarouselItem ...$ items ): self
@@ -498,7 +498,7 @@ public function render(): string
498498
499499 Html::addCssClass ($ attributes , [self ::NAME , self ::CLASS_SLIDE , $ classes , ...$ this ->cssClasses ]);
500500
501- return Div:: tag ( )
501+ return ( new Div () )
502502 ->attributes ($ attributes )
503503 ->addContent (
504504 "\n" ,
@@ -549,12 +549,12 @@ private function renderControlNext(string $id): string
549549 ->addClass (self ::CLASS_CAROUSEL_CONTROL_NEXT )
550550 ->addContent (
551551 "\n" ,
552- Span:: tag ( )
552+ ( new Span () )
553553 ->addAttributes (['aria-hidden ' => 'true ' ])
554554 ->addClass (self ::CLASS_CAROUSEL_CONTROL_NEXT_ICON )
555555 ->render (),
556556 "\n" ,
557- Span:: tag ( )->addClass ('visually-hidden ' )->addContent ($ this ->controlNextLabel )->render (),
557+ ( new Span () )->addClass ('visually-hidden ' )->addContent ($ this ->controlNextLabel )->render (),
558558 "\n" ,
559559 )
560560 ->encode (false )
@@ -580,12 +580,12 @@ private function renderControlPrevious(string $id): string
580580 ->addClass (self ::CLASS_CAROUSEL_CONTROL_PREV )
581581 ->addContent (
582582 "\n" ,
583- Span:: tag ( )
583+ ( new Span () )
584584 ->addAttributes (['aria-hidden ' => 'true ' ])
585585 ->addClass (self ::CLASS_CAROUSEL_CONTROL_PREV_ICON )
586586 ->render (),
587587 "\n" ,
588- Span:: tag ( )->addClass ('visually-hidden ' )->addContent ($ this ->controlPreviousLabel )->render (),
588+ ( new Span () )->addClass ('visually-hidden ' )->addContent ($ this ->controlPreviousLabel )->render (),
589589 "\n" ,
590590 )
591591 ->encode (false )
@@ -643,7 +643,7 @@ private function renderItem(CarouselItem $carouselItem, bool $active): string
643643 );
644644 }
645645
646- $ captionContainerTag = Div:: tag ( )
646+ $ captionContainerTag = ( new Div () )
647647 ->addClass (self ::CLASS_CAROUSEL_CAPTION )
648648 ->addContent (
649649 "\n" ,
@@ -658,7 +658,7 @@ private function renderItem(CarouselItem $carouselItem, bool $active): string
658658 ) . "\n" ;
659659 }
660660
661- return Div:: tag ( )
661+ return ( new Div () )
662662 ->addClass (
663663 self ::CLASS_CAROUSEL_ITEM ,
664664 $ carouselItem ->isActive () || $ active ? 'active ' : null ,
@@ -704,15 +704,15 @@ private function renderItems(string $id): string
704704 }
705705
706706 if ($ this ->showIndicators ) {
707- $ renderIndicators = Div:: tag ( )
707+ $ renderIndicators = ( new Div () )
708708 ->addClass (self ::CLASS_CAROUSEL_INDICATORS )
709709 ->addContent ("\n" . implode ("\n" , $ indicators ) . "\n" )
710710 ->encode (false )
711711 ->render () . "\n" ;
712712 }
713713
714714 return $ renderIndicators
715- . Div:: tag ( )
715+ . ( new Div () )
716716 ->addClass (self ::CLASS_CAROUSEL_INNER )
717717 ->addContent ("\n" . implode ("\n" , $ items ) . "\n" )
718718 ->encode (false )
0 commit comments