sfDoctrineCultureFlagsPlugin
1.0.5stable
for sf 1.4sf 1.3 and Doctrine
MIT
This plugin adds automatically-generated links to multilingual pages of your website, decorated with small beautiful flag and nice title. These links are SE-friendly direct links, so, this means Google would thank you for such surprise, hope your visitors will rate them too.
The real power of this plugin is that you don't need to mess with slugs in your template, or add code in each action. Just insert special mark in any place of your template or even layout, and add sfDoctrineCultureFlagsFilter to filters.yml
Developers
License
Copyright (c) 2010 Sergei Miami
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.5stable
|
MIT license |
1.0.0stable
|
22/05/2010 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.5stable
|
MIT license |
1.0.0stable
|
22/05/2010 |
Changelog for release 1.0.5 - 22/05/2010
- Miami: First release of the plugin
Other releases
Release 1.0.5 - 22/05/2010
- Miami: First release of the plugin
sfDoctrineCultureFlags plugin
This plugin adds automatically-generated links to multilingual pages of your website, decorated with small beautiful flag and nice title. These links are SE-friendly direct links, so, this means Google would thank you for such surprise, hope your visitors will rate them too.
The real power of this plugin is that you don't need to mess with slugs in your template, or add code in each action. Just insert special mark in any place of your template or even layout, and add sfDoctrineCultureFlagsFilter to filters.yml. Please, read installation instruction until the end...
Requirements and limitation
Plugin can auto-generate links for routes, where:
- Route is sfDoctrineRoute
- Object for this route is instance of sfDoctrineRecord with I18n behavoir.
Installation
Add pear channel
$ pear channel-discover plugins.symfony-project.org
$ pear channel-discover pear.symfony-project.com
Install the plugin
$ symfony plugin:install sfDoctrineCultureFlagsPlugin
Enable plugin in ProjectConfiguration.class.php
public function setup()
{
$this->enablePlugins('sfDoctrineCultureFlagsPlugin');
}
Publish the assets
$ symfony plugin:publish-assets
Add sfDoctrineCultureFlagsFilter to filters.yml
rendering: ~
security: ~
# insert your own filters here
culture:
class: sfDoctrineCultureFlagsFilter
param:
ru: По-руÑÑки
et: Eesti keeles
en: In English
cache: ~
execution: ~
Clear the cache
$ symfony cc
Add html comment to template or layout, in place where links must be placed.
<!-- CultureFlags -->
Customizing
Add necessary languages to filters.yml under params section.
This must be hash of cultures and in-language titles. Example:
param:
ru: По-руÑÑки
et: Eesti keeles
en: In English
If there is no flag for culture you've used, add it to
web/sfDoctrineCultureFlagsPlugin/images/flags folder
and give filenaname culture.png, for example en.png
How it works
- Fitler gets current Route name.
- From Request it gets Object attached.
- Checks condition of current Route and Object for requirements.
- By swithing cultures it builds links to our Object in another languages.
- Replaces mark in final rendered page with generated links.
Todo/plans
Do the same with standart sfPatternRoute. Is it real? Maybe no, but I'll try.