@@ -66,43 +66,41 @@ public function __construct(string $message, bool $isHtml = false)
6666
6767 //--------------------------------------------------------------------------------------------------------------------
6868 /**
69- * Returns the HTML code of the flash message.
70- *
71- * @return string
69+ * @inheritDoc
7270 */
73- public function getHtml (): string
71+ public function getWeight1 (): int
7472 {
75- $ walker = new RenderWalker ('flash-message ' );
76- $ this ->setAttrData ('auto-dismiss ' , ($ this ->autoDismiss ) ? '1 ' : null );
77- $ this ->addClasses ($ walker ->getClasses ('wrapper ' ));
78-
79- $ struct = ['tag ' => 'div ' ,
80- 'attr ' => $ this ->attributes ,
81- 'inner ' => [['html ' => $ this ->message ],
82- ['tag ' => 'button ' ,
83- 'attr ' => ['class ' => $ walker ->getClasses ('close ' ),
84- 'type ' => 'button ' ],
85- 'html ' => '× ' ]]];
86-
87- return Html::htmlNested ($ struct );
73+ return $ this ->weight1 ;
8874 }
8975
9076 //--------------------------------------------------------------------------------------------------------------------
9177 /**
9278 * @inheritDoc
9379 */
94- public function getWeight1 (): int
80+ public function getWeight2 (): int
9581 {
96- return $ this ->weight1 ;
82+ return $ this ->weight2 ;
9783 }
9884
9985 //--------------------------------------------------------------------------------------------------------------------
10086 /**
101- * @inheritDoc
87+ * @inheritdoc
10288 */
103- public function getWeight2 (): int
89+ public function htmlFlashMessage (): string
10490 {
105- return $ this ->weight2 ;
91+ $ walker = new RenderWalker ('flash-message ' );
92+ $ this ->setAttrData ('auto-dismiss ' , ($ this ->autoDismiss ) ? '1 ' : null );
93+ $ this ->addClasses ($ walker ->getClasses ('wrapper ' ));
94+
95+ $ struct = ['tag ' => 'div ' ,
96+ 'attr ' => $ this ->attributes ,
97+ 'inner ' => [['html ' => $ this ->message ],
98+ ['tag ' => 'button ' ,
99+ 'attr ' => ['class ' => $ walker ->getClasses ('close ' ),
100+ 'type ' => 'button ' ],
101+ 'html ' => '× ' ]]];
102+
103+ return Html::htmlNested ($ struct );
106104 }
107105
108106 //--------------------------------------------------------------------------------------------------------------------
0 commit comments