Download the PHP package rasuvaeff/yii3-seo without Composer

On this page you can find all versions of the php package rasuvaeff/yii3-seo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii3-seo

rasuvaeff/yii3-seo

Stable Version Total Downloads Build Static analysis Quality Security Psalm level PHP

Next.js-style typed SEO metadata for Yii3. Describe a page with one declarative Metadata object — title templates, OpenGraph, Twitter cards, hreflang, canonical URL, robots directives, icons, verification and JSON-LD — and a single MetadataDefaults instance supplies site-wide values. Tags land in <head> automatically via WebViewRenderer.

Using an AI coding assistant? llms.txt has a compact API reference ready to paste into context.

Requirements

Installation

Concept

The API mirrors the Next.js Metadata API:

Next.js yii3-seo
export const metadata = { ... } (page) new Metadata(...) dispatched per request
layout metadata (defaults) MetadataDefaults in DI params
title.template / default / absolute Title::template() / Title::absolute()
alternates.canonical / languages Alternates
openGraph / twitter OpenGraph + OgImage / TwitterCard
metadataBase MetadataDefaults(metadataBase: ...)

Defaults are merged with the page metadata: the title template wraps the page title, OpenGraph/Twitter inherit unset fields, and relative URLs are resolved against metadataBase.

Usage

1. Site-wide defaults (params)

2. Register SeoInjection in the view DI config

3. Wire the event handler

4. Dispatch SeoMetadataEvent from your action

og:title/og:description fall back to the page title/description, and twitter:* falls back to OpenGraph — no need to repeat them.

5. Title and JSON-LD in layout

<title> and <script type="application/ld+json"> are not covered by the injection interfaces. Inject SeoInjection into your layout and render manually:

Public API

Metadata

Immutable declarative object (all fields optional). A string title is normalized to Title::of().

Field Type Renders
title string\|Title <title> (template applied)
description string <meta name="description">
keywords list<string> <meta name="keywords">
authors list<Author> <meta name="author"> + <link rel="author">
applicationName, generator, creator, publisher string matching <meta name>
themeColor, colorScheme string theme-color, color-scheme
robots Robots <meta name="robots"> / googlebot
alternates Alternates canonical + hreflang links
openGraph OpenGraph og:*
twitter TwitterCard twitter:*
icons Icons <link rel="icon"> etc.
manifest string <link rel="manifest">
verification Verification verification <meta>
jsonLd list<JsonLd> <script type="application/ld+json">
other list<MetaTag> custom <meta>

MetadataDefaults

Site-wide defaults: metadataBase, title (template/default), applicationName, generator, themeColor, colorScheme, robots, openGraph, twitter, icons, verification, jsonLd, other. Provide via the rasuvaeff/yii3-seodefaults parameter.

Title

Factory Use
Title::of('Home') page title, template applied
Title::absolute('Home') page title, template bypassed
Title::template('%s | Acme', default: 'Acme') defaults: template + fallback

Alternates

Locales match /^(?:[a-z]{2}(?:-[A-Z]{2})?|x-default)$/.

OpenGraph + OgImage

TwitterCard

Robots

Factory / method Directive
Robots::index() index, follow
Robots::noindex() / nofollow() / none() / noarchive() matching directives
new Robots(['noindex', 'nosnippet']) custom combination
->withNoSnippet() / ->withNoImageIndex() append directive
->withMaxSnippet(-1) / ->withMaxImagePreview('large') / ->withMaxVideoPreview(30) Google max-*
->withGoogleBot('noindex', ...) separate <meta name="googlebot">

Icons / Icon, Verification, Author

MetaTag

Factory Attribute
MetaTag::name(name, content) name="..."
MetaTag::property(property, content) property="..."
MetaTag::httpEquiv(httpEquiv, content) http-equiv="..."

JsonLd

Renders as <script type="application/ld+json"> with JSON_HEX_TAG to prevent </script> injection.

SeoInjection

Singleton registered in DI. Implements MetaTagsInjectionInterface + LinkTagsInjectionInterface. The package DI config also registers a service reset hook, so stale per-request metadata is cleared between requests in reusable runtimes.

Method Description
setMetadata(Metadata) Set metadata for the current request
clear() Reset (useful in tests)
getTitle(): string Resolved title for <title>
getMetaTags(): list<Meta> Called by WebViewRenderer
getLinkTags(): array<Link> Called by WebViewRenderer
getJsonLdHtml(): string Rendered JSON-LD <script> blocks

Security

Examples

See examples/ for runnable scripts and a Yii3 integration sketch: examples/yii3-app.php.

Development

License

BSD-3-Clause. See LICENSE.md.


All versions of yii3-seo with dependencies

PHP Build Version
Package Version
Requires php Version 8.3 - 8.5
ext-filter Version *
yiisoft/html Version ^3.13 || ^4.0
yiisoft/yii-view-renderer Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rasuvaeff/yii3-seo contains the following files

Loading the files please wait ...