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

PHP Fatal Error – yii\base\ErrorException Call to a member function shareUrl() on string #6

Open
hdushku opened this issue Apr 15, 2016 · 3 comments

Comments

@hdushku
Copy link

hdushku commented Apr 15, 2016

When I try to add a share link to my post shows me the following error:

PHP Fatal Error – yii\base\ErrorException

Call to a member function shareUrl() on string

', $post->content->shareUrl(ShareLinks::SOCIAL_FACEBOOK), ['title' => 'Share to Facebook']) ?>
@iJackUA
Copy link
Owner

iJackUA commented Apr 15, 2016

You are using it incorrect. shareUrl could be called only inside widgets template.
Follow usage instructions please https://github.com/iJackUA/yii2-sharelinks-widget#usage-example

@hdushku
Copy link
Author

hdushku commented Apr 15, 2016

Thank you,
It seems that is working now but the buttons for sharing are not showing. (I'm using writesdown cms from [https://github.com/writesdown/app-cms](writesdown cms)
Its displaying ok in chrome developer tool when I inspect the elements.

@iJackUA
Copy link
Owner

iJackUA commented Apr 15, 2016

It doesn't show Icons by default, just letters like "Fb" etc. https://github.com/iJackUA/yii2-sharelinks-widget/blob/master/views/main.php#L13
You need to make a custom view with your own Icons (whatever you like).

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