contao/test — Issue #928: one-root-I18N site
Author: importer
Created: 2011-11-28 17:40:21+00:00
State: open
Labels: Feature, framework

Hi, team.
I would like to suggest a new feature for typolight(may be in some next major release).
Please take a look at my forum post to see what I am thinking about:
http://www.typolight-community.org/viewtopic.php?f=6&t=345

I looked at the code for some hook but what I would like to change is not possibble unless I subclass "abstract class Module" which extends Frontend and overwrite protected function renderNavigation($pid, $level=1).

The problem is that the SQL is hardcodded into PHP
and can not just be replaced.

I would suggest that all SQL is separated from the PHP.
This could be achieved by placing all SQL in separate file(s).
See how I achieved it here:
http://bcc.svn.sourceforge.net/viewvc/bcc/trunk/bgcc/data/mysql.queries.sql?view=markup

Then I put the parsed file in an associative array and use it in the code:

http://bcc.svn.sourceforge.net/viewvc/bcc/trunk/bgcc/perl/lib/BGCC/Model.pm?view=markup
see there "sub sql_q{...}"
Then...

```
`query_args = ( $self->sql_q->{pages}, $where->{pid}, $where->{lang_id}, $t, $t );
return $self->dbh->query(`query_args)->hashes;
#prepare and execute in one
```

It is Perl, but you get the idea.
This will make the whole system very flexible.
Every query can be changed independently from the PHP code

So I(anyone) will be able even if you do not add the "one-root-I18N site" feature to change several queries and "voila".

Well, I hope at least You will consider one or the othr thing
(one-root-I18N site|separate SQL from PHP)

There are also many good DB abstraction Classes for PHP.
Thanks for reading

--- _Originally created by kberov on August 4th, 2009, at 12:44am (ID 928)_