Releases for sf 1.0
| Version |
License |
API |
Released |
|
0.8.0beta
|
MIT license |
0.8.0beta
|
13/03/2007 |
|
0.7.0beta
|
MIT license |
0.7.0beta
|
02/03/2007 |
Plugin by COil.
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.
Changelog for release 0.8.0 - 13/03/2007
Not available
Other releases
Release 0.8.0 - 13/03/2007
Not available
Release 0.7.0 - 02/03/2007
Not available
Installation for sf 1.0
php symfony plugin-install http://plugins.symfony-project.org/sfJoomlaBridgePlugin
PEAR
Download the PEAR package
sfJoomlaBridge
sfJoomlaBridge is a symfony plugin that provides a bridge between a Joomla and a Symfony application. It allows to display symfony pages into Joomla.
It adds a new helper class : Joomla with 2 main functions :
* link_to_joomla($module_action), to make a link to another symfony page (action/module) but in the Joomla application context.
* form_tag_joomla($internal_uri = ' ', $options = array()), to declare a form that will be sumbitted to Symfony in joomla context.
* import_sf_resources(), used internally by the plugin to add specific Symfony resources (Ajax js for exemple)
Installation
Install the plugin
symfony plugin-install http://plugins.symfony-project.com/sfJoomlaBridgePlugin
or download it and unzip in your /plugins directory
Copy the files in /web/sfJoomlaBridge directly to your application /web directory (com_symfony folder should be now in the web/components/ directory of Joomla)
Clear you cache
symfony cc
Configuation
Joomla component
In web/components/com_symfony, open symfony.html.php, line 8 modify the name of Symfony controller file (frontoffice.php by default). Take care to use a production controller, because we should't have any debug information.
Un-comment line 34 with file_get_contents if you don't have curl installed on you web server, and comment the curl related lines above.
In /web/index.php of Joomla main controller
before (near line 114)
// mainframe is an API workhorse, lots of 'core' interaction routines
$mainframe = new mosMainFrame( $database, $option, '.' );
$mainframe->initSession();
add
//Before Joomla initialize its mainframe, lets play…
// check missing component — added before $mainframe is being initialized
//##########################
if (!file_exists($mosConfig_absolute_path . '/components/'. $option )) {
$option = 'com_symfony';
//set component to com_cake if a controller is not found.
}
Symfony
First you need to modify the absolute path of the joomla controller in /plugins/sfJoomlaBridgePlugin/config/config.php, by default it's /index.php
Views : If your symfony application will only be used indise the Joomla application, you can disable the layout globally in apps/app/config/view.yml
has_layout: off
Or it is not the case, you can disable the layout for some pages (view.yml of concerned module)
We need to enable a new filter specific for this plugin. Open /plugins/sfJoomlaBridge/config/_filter.yml and copy paste the content after the common filter of the filter.yml of you application, at this point your file should look like this :
rendering: ~
web_debug: ~
security: ~
generally, you will want to insert your own filters here
cache: ~
common: ~
joomla:
class: sfCommonJoomlaFilter
param:
head_tag: head_joomla
flash: ~
execution: ~
In the template there is a special tag that will be used by the filter
In fact this tag will be used (and replaced) to add dynamically specific web resources for Symfony (js, css). You can modify this tag in filter.yml by modifying the head_tag parameter of the joomla filter. If your template doesn't need any resource, you can ignore it.
Usage
1 - You need to declare the following helpers (or use the default helpers loaded parameter in you settings.yml) :
2 - To make a link to another symfony page, in this case to the module index and the users action.
3 - To declare a form that will be handled by Symfony, in this case form will be submitted to validateCreate action of users module
'sf_admin_create_form',
'name' => 'sf_admin_create_form',
)) ?>
Changelog
0.8.0
- Can handles Symfony forms now (get method)
- Allow standard use of Symfony Ajax helpers
- New specific filter
- New helpers to add sf resources dynamically
0.7.0
Demo
Notes
- This plugin is still beta.
- I am searching beta testers to get some feeback. (C0il on IRC on, comment on my blog or whatever you want !)
TODO
COil :)