Search

Hi all,

Since a few days I’ve been playing around with Symphony and going through the tutorials to evaluate if I’ll use it in a project or not.

So far, I get the impression that Symphony offers great capabilities when it comes to:

  • reading that from the server or other websites
  • filtering data
  • displaying it on the screen in any possible way
  • handle user inputs for “blog like” websites

When it comes to user input to custom database schemas, options are completely nonexistent.

In the project I’ll work on I need work on a certain schema, with different constraints and relations among the tables, so I can’t use the “Entries” as if they were blog posts, I need to get user input for insert and update operations into the DB. Just like there are “Data Sources”, it would be nice that there were “Data Destinations” as well, so that I could specify a PHP file to handle the user input and not to have to use Symphony’s default DB.

Please correct me if I’m wrong, if there are easy ways to do these things I’m eager to hear about them, this is just the impression I got from the tutorials and documentation I’ve seen so far, and by playing around with the options available.

You could try to write an event which, when attached to the page (and conditions are met), will save your data to the second database. To retrieve those data you will need a custom data source, so it will be best to put everything into a dedicated extension.

When it comes to user input to custom database schemas, options are completely nonexistent.

The default “workspace” that comes with the Symphony download is a model of a blog (Articles, Images, Comments etc.) since web developers will be immediately familiar with the context. But this is just scratching the surface — Symphony lets you build quite complex schemas as if you were simply using an RDMS. There are Symphony terms that map nicely onto RDMS terms:

  • Section (an entity’s schema i.e. a table)
  • Field (the content type i.e. a column)
  • Entry (content i.e. a row)

You can link Sections (tables) together using one of several relationship fields. The most common is the core Select Box Link field, but there are also Reference Link, Bi-Link and the forthcoming Subsection field.

it would be nice that there were “Data Destinations” as well, so that I could specify a PHP file to handle the user input and not to have to use Symphony’s default DB.

I hear you. But I expect this would be a pretty edge case. 99% of the time Symphony should be capable of storing the data you need. If you want to interface with another database then I suggest building in Symphony and using the good spread of delegates to add your own hooks and catch the data as it passes through the system.

Say for example you’d like to insert a row (entry) into another database entirely, but keep the editing through the Symphony UI. You’d model your data in Symphony with a section that contains all of the content (data) fields you will need. Just by building the Section you get the form UI for CRUD operations on that section, it’s built for you. You can write a simple Extension (a Symphony plugin, written in PHP) that subscribes to two delegates EntryPostCreate and EntryPostEdit, which fire (unsurprisingly) after an entry has been either created or edited. The delegate callback function will be passed the Symphony “Entry” object which you can modify and send back, or serialise to another database schema should you wish.

Could you be a bit specific about your requirements, and maybe I could give a more accurate example.

Thanks for answering,

Ok it seems that I should be able to somehow define my schema in Symphony.

In order to create my own schema then, is it necessary to define it manually in the YAML files? I still feel that I’m missing something, how do I create the relationships between the “tables” (sections)? how are default values, autoincrement and other DB constraints dealt with?

@nickdunn: Something simple I will need to do in my project would be calling PHP files from Symphony (passing parameters). Some of these PHP files may need to perform CRUD operations.

In order to create my own schema then, is it necessary to define it manually in the YAML files?

There are no YAML files in Symphony. Could it be that you are talking about Symfony with an “f”? That’s something completely different. (Wrong forum then.)

Hmm yes, seems like you are maybe talking about a completely different piece of software. This is Symphony CMS (a PHP content management system/framework) whereas symfony is a standalone PHP framework.

Still, if you pursue Symphony CMS itself (which sounds more like what you’re trying to do, I think) then try downloading Symphony 2.0.6 and seeing the default “workspace” which includes a basic blog. Pick apart how the sections are structured and related, then delete them all and build your own structure exactly how you need it.

Symphony is point-and-click, no actual coding required to model your data. The only coding you’ll need (generally) is XSLT (the templating layer, which creates your final HTML markup).

Something simple I will need to do in my project would be calling PHP files from Symphony (passing parameters). Some of these PHP files may need to perform CRUD operations.

This would be done via the delegates system. Decide where you want to execute your custom code, find a delegate that executes at this time, register your own callback function that subscribes to that delegate, and insert your custom code into that function. This keeps your custom code in an extension (plugin) without having to modify Symphony’s core.

Haha it seems indeed that it was Symfony (with f) that I was looking for, a friend recommended it to me and I didn’t realize they weren’t the same until a few hours ago.

I spent many days learning how to use Symphony and XSLT until I finished all the tutorials, I found it a very nice framework to work on, but it isn’t what I need at the moment because I need a lot of custom code and for now I’m gonna stick to a more conventional way of modeling databases. Although I’m probably gonna get back to Symphony in the future when the new version comes out and more tutorials become available.

Thank you guys for the support.

Best luck.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details