PHP code example of xorgxx / neox-seo-bundle
1. Go to this page and download the library: Download xorgxx/neox-seo-bundle library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xorgxx / neox-seo-bundle example snippets
Bundles.php
return [
.....
NeoxSeo\NeoxSeoBundle\neoxSeoBundle::class => ['all' => true],
.....
];
myController.php
use NeoxSeo\NeoxSeoBundle\Attribute\NeoxSeo;
....
#[NeoxSeo( title: 'home page', charset: 'UTF-8', metasHttpEquiv: ['Content-Type'=>'text/html; charset=utf-4', 'Accept'=>'text/html; charset=utf-8'])]
class HomeController extends _CoreController
{
#[Route('/{id}/send', name: 'app_admin_tokyo_crud_send', methods: ['GET'])]
#[NeoxSeo( title: 'home index', metasName: ['keywords' =>'bar', 'description' => 'foo', 'robots' => 'index,follow'])]
public function index( Request $request): Response
{
....
}
myController.php
#[NeoxSeo( title: 'home page', charset: 'UTF-8', metasHttpEquiv: ['Content-Type'=>'text/html; charset=utf-4', 'Accept'=>'text/html; charset=utf-8'])]
class HomeController extends _CoreController
{
/**
* @param NeoxSeoService $neoxSeoService
*
* @return Response
*/
#[Route('/{id}/send', name: 'app_admin_tokyo_crud_send', methods: ['GET'])]
#[NeoxSeo( title: 'home index', metasName: ['keywords' =>'bar', 'description' => 'foo', 'robots' => 'index,follow'])]
public function index(NeoxSeoService $neoxSeoService): Response
{
$neoxSeoService->getSeoBag()
->setTitle("home-page")
->setMetasHttpEquiv([
'Content-Type'=>'text/html; charset=utf-56',
'Accept'=>'text/html; charset=utf-8',
'capnord'=>'text/html; charset=utf-8',
])
;
}
.....