定制 remithomas/rt-headtitle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

remithomas/rt-headtitle

Composer 安装命令:

composer require remithomas/rt-headtitle

包简介

ZF2 Plugin to set title easily to your pages from controllers actions

README 文档

README

ZF2 HeadTitle plugin, you can easily set any title within yours controllers actions

Features / Goals

  • Set and manage your titles from controllers actions

How to install ?

Using composer.json

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "minimum-stability": "dev",
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "dev-master",
        "remithomas/rt-headtitle": "dev-master"
    }
}

Activate the module :

application.config.php

<?php
return array(
    'modules' => array(
        'Application',
        'RtHeadtitle',
    )
);
?>

Only activated in one module

If you need to use this plugin only in one module. Just copy this code and add it into your own module config (module.config.php)

<?php
return array(
    'controller_plugins' => array(
        'invokables' => array(
            'HeadTitle' => 'RtHeadtitle\Controller\Plugin\HeadTitle',
        )
    ),
    ...

Activated for all the application

If you need to use this plugin in all your application. Just copy the file rt-headtitle.global.php.dist (/vendor/remithomas/rt-headtitle/config/) and paste it into the folder /config/autoload/

Change your Layout.phtml

<html lang="en">
    <head>
      <?php echo $this->headTitle(); ?>
    </head>
    <body>content</body>
</html>

How to use ?

How to use in your controller action !

public function indexAction(){
    $this->headTitle("My website")->setSeparator(" - ")->append("easy ?!");
    return new ViewModel();
}

统计信息

  • 总下载量: 33.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-03-25