2017 © Pedro Peláez
 

library RuianSeoBundle

A simple symfony2 bundle to add custom meta to your layout(s)

image

ruian/RuianSeoBundle

A simple symfony2 bundle to add custom meta to your layout(s)

  • Monday, July 9, 2012
  • by ruian
  • Repository
  • 2 Watchers
  • 2 Stars
  • 1,120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

RuianSeoBundle

Build Status, (*1)

, (*2)

Installation

Step 1) Get the bundle

First, grab the RuianSeoBundle :, (*3)

Add the following lines to your deps file and then run php bin/vendors install:, (*4)

[RuianSeoBundle]
    git=git://github.com/ruian/RuianSeoBundle.git
    target=bundles/Ruian/SeoBundle

Step 2) Register the namespaces

Add the following two namespace entries to the registerNamespaces call in your autoloader:, (*5)

``` php <?php // app/autoload.php $loader->registerNamespaces(array( // ... 'Ruian' => DIR.'/../vendor/bundles', // ... ));, (*6)


### Step 3) Register the bundle To start using the bundle, register it in your Kernel: ``` php ## Use it You can set your title and metas with the DIC (all entries are optional) ``` yaml #/app/config/config.yml ruian_seo: title_prefix: '[FR] ' title: "My website is awesome" title_suffix: ' - jgalenski.com' metas: keywords: "Cool, stuff" description: "a cool description" ...: ... metas_http_equiv: charset: "utf8" ...: ... ``` Or with your controller ``` php //... DefaultController.php public function indexAction() { // ... $this->get('ruian.seo.page')->setTitle("My website title"); $this->get('ruian.seo.page')->setMeta('keywords', "Cool, stuff"); $this->get('ruian.seo.page')->setMeta('description', "a cool description"); $this->get('ruian.seo.page')->setMetaHttpEquiv('charset', 'utf8'); // ... ) ``` And now see the result in your layout/view ## PHP ``` php renderTitle() ?> <?php echo $view['ruian.seo.page']->renderMetas() ?> </head> <body> <!-- ... --> </body> </html>

TWIG

twig <html> <head> {{ ruian_seo_title() }} {{ ruian_seo_metas() }} </head> <body> <!-- ... --> </body> </html>, (*7)

, (*8)

TODO

..., (*9)

The Versions

09/07 2012

dev-master

9999999-dev

A simple symfony2 bundle to add custom meta to your layout(s)

  Sources   Download

The Requires

  • php >=5.3.2