Phalcon PHP Meta tags Service

Overview

About

Phalcon meta tags plugin for PhalconPHP.

This plugin allows you to easily and flexibly customize the meta tags of your view.

If this plugin helped you, be glad to see your star, thank you.

Check out new validation package for PhalconPHP https://github.com/izica/phalcon-validation

Install

    composer require izica/phalcon-meta-tags

Plugin functions

    setTitle($title)
    getTitle()
    setByProperty($property, $content)
    unsetByProperty($properties) //array or single property name

    setByName($name, $content)
    unsetByName($properties) //array or single name

    setCustom($key, $attributes) //unique key and attributes array
    unsetCustom($keys) //array or single value
    getMeta() // return metas string

Usage:

Register plugin as service:

    $di = new DI();
    $di->set('metatag', function() {
    	return new IzicaMetaTags();
    });

Add data to your layout:

    <!DOCTYPE html>
    <html>
        <head>
            <?php echo $this->metatag->getTitle();?>
            <?php echo $this->metatag->getMeta();?>
        </head>
        <body>
             <?php echo $this->getContent(); ?>
        </body>
    </html>

Use service in controller, view or middleware(anywhere):

    use Phalcon\Mvc\Controller;

    class IndexController extends Controller
    {
        public function indexAction()
        {
            $this->metatag->setTitle("Phalcon MetaTags Service");

            $this->metatag->setCustom("charset", ['charset' => 'UTF-8']);
            $this->metatag->setCustom("http", ['http-equiv' => 'content-type', 'content' => 'text/html; charset=UTF-8']);

            $this->metatag->setByName("description", "phalcon php metatags");

            $this->metatag->setByProperty("og:description", "When Great Minds Don’t Think Alike");
        }
    }

Example of output:

    <title>Phalcon MetaTags Service</title>        
    <meta name="description" content="phalcon php metatags">
    <meta property="og:description" content="When Great Minds Don’t Think Alike">
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">  
You might also like...
High performance view templating API for PHP applications using tags & expressions inspired by Java JSTL and C compiler

View Language API Table of contents: About Expressions Tags Configuration Compilation Installation Unit Tests Examples Reference Guide About This API

Auto-expiring tags with additional payload data on any eloquent model.

Laravel TempTag Auto-expiring tags with additional payload data on any eloquent model. Installation first you need to install and configure mongodb in

This Statamic addon allows you to modify the tags rendered by the Bard fieldtype, giving you full control over the final HTML.

Bard Mutator This Statamic addon allows you to modify the tags rendered by the Bard fieldtype, giving you full control over the final HTML. You can ad

Smd tags - A Textpattern CMS plugin for unlimited, structured taxonomy across content types.

smd_tags Tag articles, images, files and links with stuff, then use the public-side tags to display the lists, filter or find related content. Feature

A Zend_Cache backend for Redis with full support for tags (works great with Magento)

Zend_Cache backend using Redis with full support for tags This Zend_Cache backend allows you to use a Redis server as a central cache storage. Tags ar

A custom twig extension to truncate text while preserving HTML tags.

TwigTruncateExtension A custom twig extension to truncate text while preserving HTML tags. Installation Add the library to your app's composer.json:

Android libraries and/or signatures with classification (type, tags, anti-features)

Android Libraries A list of Android libraries and/or trackers along with classification such as type, categories and ant-features. Development Status:

TYPO3 CMS extension which extends TYPO3 page cache, by tags based on entities used in fluid templates.

Fluid Page Cache for TYPO3 CMS This TYPO3 CMS extension allows you to clear frontend page caches, automatically when a displayed record has been updat

The WordPress Categories to Tags Converter.

=== Categories to Tags Converter === Contributors: wordpressdotorg Donate link: Tags: importer, categories and tags converter Requires at least: 3.0

Comments
  • No conversion to HTML entities for attributes

    No conversion to HTML entities for attributes

    Hi, I came across this and wanted to let you know that, unless I'm mistaken, there is no conversion to html entities occurring for the attributes. For example, if someone puts a quote " I believe the code will break. May be worth exploring using html_entities() with the user's currently set character set in Phalcon.

    opened by jesseforrest 1
  • Error: Call to a member function setTitle() on null

    Error: Call to a member function setTitle() on null

    Hi,

    I just installed the plugin, but I got this error, do you know why? I did exactly the same as what is written in the readme file Error: Call to a member function setTitle() on null

    opened by Simonbrl 1
Releases(0.0.4)
Owner
null
Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hosted at PackageCloud.

Phalcon Builder - is a packaging system that make it easy and quick to build Phalcon packages such as rpms, debs, etc. Phalcon's distribution that hos

The Phalcon PHP Framework 26 Oct 7, 2022
A Phalcon paginator adapter for Phalcon Collections

Phalcon Collection Paginator A Phalcon paginator adapter for Phalcon Collections Why create this? Being familiar with the various Pagination data adap

Angel S. Moreno 2 Oct 7, 2022
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

THE TARS FOUNDATION PROJECTS 9.6k Jan 1, 2023
LaraNx Seo enables your Laravel app to store SEO and social media meta tag data in database instead of your code

LaraNx Seo enables your Laravel app to store SEO and social media meta tag data in database instead of your code. Moving marketing data out of your code base and into your database where it is easily modified.

srg 13 Dec 29, 2022
Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options

Coder Metabox for WordPress Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options. Step 1 call coder-metabox.php file in functi

Ashikur Rahman 3 Feb 19, 2022
A privacy respecting free as in freedom meta search engine for Google and popular torrent sites

A privacy respecting free as in freedom meta search engine for Google and popular torrent sites

null 329 Dec 27, 2022
Addon for Cockpit CMS - store thumbnails and meta data for video links

VideoLinkField Addon for Cockpit CMS Copy a url from YouTube or Vimeo, click the Button "Find Values", wait a second and in the background starts a se

Raffael 3 Oct 2, 2022
OctoberCMS BlogHub Plugin - Extends RainLab's Blog extension with custom meta details, additional archives and more.

BlogHub extends the RainLab.Blog OctoberCMS plugin with many necessary and helpful features such as Moderatable Comments, Promotable Tags, Custom Meta Fields, additional Archives, basic Statistics, Views counter and more.

rat.md 5 Dec 15, 2022
Meta data for humans and machines.

Deutsch English Svenska Meta 0.8.15 Meta data for humans and machines. How to add meta data This extension generates meta data for the Open Graph prot

Anna 2 Nov 4, 2022