chriskonnertz / open-graph Goto Github PK
View Code? Open in Web Editor NEWLibrary that assists in building Open Graph meta tags
License: MIT License
Library that assists in building Open Graph meta tags
License: MIT License
Example:
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
Hello,
when running tests, from CLI, you can get: that REQUEST URI is unidetified.
At this string:$safeRequestURI = htmlentities(strip_tags(urldecode($_SERVER['REQUEST_URI'])));
is the 'isset()' here enoght? Or are there any other 'cirmustances' to avoid?
Thank you
In order to avoid issued with the OpenGraph::attributes()
method in the future (see #30 ) a unit test for this method has to be added.
Hi,
Documentation says that we should use renderTags() method inside template like this {{ $og->renderTags() }}
which I believe is not correct, at least for Laravel 5.1.
I'm new in Laravel, using 5.1 and I was able to render meta tags correctly only without escaping it like this:
{!! $og->renderTags() !!}
Maybe I'm wrong and missing something, if so let me know.
For now as I see It's just documentation problem, everything works well, thanks for this awesome package!
You could change the $date instanceof DateTime
to is_a($date, 'DateTime')
to allow Carbon (https://github.com/briannesbitt/Carbon) dates too.
Method OpenGraph::convertDate has return type string
, but can return parameter $date which not typed and not casted. So may be use typed parameter in this method or cast parameter to string in return statement.
Add support to PHP 8
Hello, have been a happy user of this package for 6 months or so however the latest commits were not backwards compatible.
Any chance of tagging a release and implementing semver?
Bitte in der Datei composer.json folgende zeile 28 bearbeiten "OpenGraph' => 'ChrisKonnertz\OpenGraph\OpenGraphFacade'" in "OpenGraph' => 'ChrisKonnertz\OpenGraph\OpenGraph".
Leider wird sonst dieses Modul von Laravel nicht direkt angesprochen und muss manuell bearbeitet werden.
By accident i pass wrong image string to image()
method and get strange error:
Call to undefined function ChrisKonnertz\OpenGraph\asset()
I found several asset
function calls in OpenGraph
class:
Fast investigation gave me no traces of this function. Can somebody satisfy my curiosity?
Hello,
I've had this alert for some time now:
Creation of dynamic property ChrisKonnertz\OpenGraph\OpenGraph::$title is deprecated in /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Store.php on line 117
Note that I don't use this property in my code ...
chriskonnertz/open-graph 2.0
PHP 8.2.5
Laravel 9.52.15
Cordialy
$og = new ChrisKonnertz\OpenGraph\OpenGraph();
$og->title('Apple Cookie')
->type('article')
->image('http://example.org/apple.jpg')
->description('Welcome to the best apple cookie recipe never created.')
->url();
$res = $og->renderTags();
print_r($res);
echo $res;
var_dump($res); //string(0) ""
The result variable is empty. Nothing is output. Why is that?
ps php 7.2
...which therefore fails Facebook's validation (https://developers.facebook.com/tools/debug/og/object/).
and seemingly is against the spec - http://ogp.me/#type_article
Can you confirm that 'og:article:XXX' is definitely right?
Here's the relevant validation output:
Warnings That Should Be Fixed
Extraneous Property Objects of this type do not allow properties named 'og:article:published_time'.
Extraneous Property Objects of this type do not allow properties named 'og:article:modified_time'.
Parser Mismatched Metadata The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input properties that were not seen in the parsed result: 'og:article:published_time, og:article:modified_time'
Since it uses substr
rather than mb_substr
a multibyte character spanning the max length boundary will get turned into an invalid character.
Luckily the fix is trivial, but it would be nice to have a test case added too :-)
Have you considered throwing in an optional service provider facade thing? Some use cases of this open-graph would benefit from there being one of those things.
Remove whitespace from the PHP code section in the README.md
$og->video( 'https://www.youtube.com/embed/123', ['type' => 'text/html'] );
leads to
Attempted to call function "starts_with" from namespace "ChrisKonnertz\OpenGraph".
First thing: awesome package! Exactly what i searched for!
Sad thing: the composer.json file says your package needs PHP 5.4 to work. I sadly don't have PHP 5.4 and was wondering if the code would probably also work with PHP 5.3.* ?
it doesn't work in laravel 5.5. Getting this error:
Call to undefined method ChrisKonnertz\OpenGraph\OpenGraphFacade::title()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.