summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/web/src/Compat/Multipart.php
blob: 432f837d8cb219730124b703eac5a9b7c2050bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

namespace ipl\Web\Compat;

use ipl\Html\HtmlDocument;
use ipl\Html\HtmlString;

class Multipart extends HtmlDocument
{
    /** @var string */
    protected $for;

    protected $contentSeparator = "\n";

    /**
     * Set the container's id which this part is for
     *
     * @param string $id
     *
     * @return $this
     */
    public function setFor($id)
    {
        $this->for = $id;

        return $this;
    }

    protected function assemble()
    {
        $this->prepend(HtmlString::create(sprintf('for=%s', $this->for)));
    }
}