Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add subtitle for GenericTemplate? #83

Closed
quangtam opened this issue Aug 31, 2017 · 1 comment
Closed

How to add subtitle for GenericTemplate? #83

quangtam opened this issue Aug 31, 2017 · 1 comment

Comments

@quangtam
Copy link

Hi, Could you please help me to know how to add subtitle for generictemplate?

@CasperLaiTW
Copy link
Owner

Hi, Subtitle is in new Element($title, $subtitle) or $generic->addElement($title, $subtitle)

description equal to subtitle.

$generic = new GenericTemplate($message->getSender());
        $defaultButton = new UrlButton(null, 'https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template');
        $generic
            ->addElement('First item', 'description')
            ->buttons()
            ->addPostBackButton('First Button')
            ->addWebButton('facebook', 'https://facebook.com');
        $generic->addElement('Second item', 'description')
            ->buttons()
            ->addPostBackButton('Second Button')
            ->addWebButton('google', 'http://www.google.com')
            ->addShareButton();
        $this->send($generic);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants