Showing posts with label cakephp meta tages. Show all posts
Showing posts with label cakephp meta tages. Show all posts

Sunday, May 29, 2011

Set Meta Tags (SEO Tags) in CakePHP


Hello Friends,
In my previous post, i show you the way how to set Page Title Tag in CakePHP. But setting Meta keywords and Meta Description is not the same way as Meta Title. .Also Meta Keyword and Meta Description is important part of Search Engine Optimization. Refer to below syntax to set Meta tags in CakePHP.
<?php
echo $html->meta(‘keywords’,'enter any meta keyword here’);
?>
//Output <meta name=”keywords” content=”enter any meta keyword here”/>
<?php
echo $html->meta(‘description’,'enter any meta description here’);
?>
//Output <meta name=”description” content=”enter any meta description here”/>
If you find any problem in this than let me know by comment.


Set Meta Title (Page Title) in CakePHP 1.2/1.3


Hello Friends,

As i mention in my previous posts, CakePHP 1.3 come up with lots of new syntax changes. I was looking for a Meta Title SEO tag for each page. I need to set this Meta Title (Page Title) for each page. You must be aware that Page Title can be set in method which we write in respective controller. Look at below syntax changes in CakePHP 1.2 and CakePHP 1.3 for setting Page Title.
CakePHP 1.2
$this->pageTitle = “Page Title Value”;
CakePHP 1.3
$this->set(“title_for_layout”,”Page Title Value”);
If you find any problem in this than let me know by comment.


Zip Component in CakePHP-Add files in Zip


Hello Friends,
Today i have implemented a Zip functionality in CakePHP. If you want to create an archive file consists of some files to give a download Zip fileoption to user than i might help you to show the steps. Below are the steps how to zip all files and save it to some folder.
$this->Zip->addFile($src_file,$file_name_inzip);
$this->Zip->saveZip(“myzipfile.zip”);
First you can download the file given in link and place above file in components directory in your app/controller folder. Now you can call the function addFile for adding files in zip. Once you will call this function it will read all data from src_file. Now you can save those data to Zip file by calling saveZip function.
If you find any problem in this than let me know by comment.