BackEnd new page without linking a mysql Table

How to develop custom Contao extensions

BackEnd new page without linking a mysql Table

Postby synergie » Mon Jan 18, 2010 9:36 am

Hello,

I understood the creation of page on BackEnd (linked with the internal ORM, 1:1 relation to a mysql table), that very simple.

Now I want to create a new page that are NOT linked to a table. I try to make it but the ORM automatically make a "Select * from NamePage" in the database (and crash because there no table with this name).

What must I do to stop this automatic Select (for this page only)? Overriding a method?
User avatar
synergie
User
 
Posts: 41
Joined: Mon Nov 23, 2009 2:27 pm
Location: Valais, Switzerland

Re: BackEnd new page without linking a mysql Table

Postby ramjet » Mon Jan 18, 2010 9:48 am

Sorry, What is ORM synergie?
ramjet
User
 
Posts: 536
Joined: Sat Jun 20, 2009 12:24 pm

Re: BackEnd new page without linking a mysql Table

Postby synergie » Mon Jan 18, 2010 10:22 am

ramjet wrote:Sorry, What is ORM synergie?

Object-relational mapping http://en.wikipedia.org/wiki/Object-relational_mapping
Typolight have an internal ORM that make a generation 1 mysql.Table = 1 php.Class.
User avatar
synergie
User
 
Posts: 41
Joined: Mon Nov 23, 2009 2:27 pm
Location: Valais, Switzerland

Re: BackEnd new page without linking a mysql Table

Postby synergie » Tue Jan 26, 2010 4:16 pm

did somebody have an idea?
User avatar
synergie
User
 
Posts: 41
Joined: Mon Nov 23, 2009 2:27 pm
Location: Valais, Switzerland

Re: BackEnd new page without linking a mysql Table

Postby ga.n » Wed Jan 27, 2010 8:14 am

What do you want to do exactly?

I can not understand what "create a new page that are NOT linked to a table" means ...

TYPOlight relies on DataContainer for creating record; the built-in DataContainer are

DC_Table for managing record that are stored in a database table (like pages, articles, news, layouts etc.)
DC_Folder for managing files (like files and templates)
DC_File for managing the file settings configuration

you can find the above classes into the system/drivers/ directory of your TYPOlight installation

maybe you want to create your own DataContainer
Did you find this post useful?
You may wish to take a look at
User avatar
ga.n
User
 
Posts: 147
Joined: Fri Jun 19, 2009 5:03 pm

Re: BackEnd new page without linking a mysql Table

Postby synergie » Wed Jan 27, 2010 9:00 am

hum... I found I let "Table" in the DCA and not "File". So it was an automatique "SELECT * from ..." and the name of the php file as name of the table.
Now it is ok with "File".

Thanks, ticket closed ;-)
User avatar
synergie
User
 
Posts: 41
Joined: Mon Nov 23, 2009 2:27 pm
Location: Valais, Switzerland

Re: BackEnd new page without linking a mysql Table

Postby thyon » Thu Mar 04, 2010 12:04 pm

You can look at the settings or Maintenance BE apps, they do not directly use any tables, but perform custom controls to the user and do not follow the standard guidelines of using a DC_xxx driver.... You can with this approach edit anything, be it a web service updated, or an RSS feed, or something else that is retrieved from the internet... But this will require you to write ALL the code for every little bit - edit, copy, paste, delete, etc... its all in your hands.

Another module that is custom, although it is using a table is the Task Manager... but its interface doesn't use a DC_xxx driver as well, it uses its own methods for edit and copy and paste... This just shows you how flexible TL really is.
User avatar
thyon
Developer
 
Posts: 722
Joined: Wed Jun 10, 2009 10:02 pm
Location: Cape Town, South Africa

Re: BackEnd new page without linking a mysql Table

Postby jwalter » Tue Mar 09, 2010 12:41 pm

Hi synergie,
I am glad that you have found to solution to your problem. I am not quite sure about what you were trying to do, I was just thinking about it but couldn't stop myself from asking you about what you were trying to achieve as you didn't want any SQL query to be called on that page.
jwalter
User
 
Posts: 2
Joined: Tue Mar 09, 2010 9:57 am


Return to Developer's corner

Who is online

Users browsing this forum: No registered users