Hello,

I'm trying to make an extension for Arastta but a really want to no what the standard prefix is for the database tables of Arastta.

So that i can chance the SQL file that it is forevery one the same.

Regards Martin
Tuesday, November 13 2018, 01:17 PM
Share this post:
Responses (2)
  • Accepted Answer

    Hackasacka
    Hackasacka
    Offline
    Wednesday, November 14 2018, 02:59 AM - #Permalink
    Hi Martin,

    Perhaps you could read the contents of the "config.php" in the root using PHP and search for the "define('DB_PREFIX', 'arxy_');"?

    However, if you look at the documentation for developers you could use the Arastta API used within the MVC structure:-
    https://arastta.org/docs/developers/quick-start

    Maybe, have a look at a simple example of an existing module i.e. "category" or "product" as they are the most commonly used and if you exclude the ""Dashboard" and the "Admin" interface, you only need look at at the "catalog" folder and the files in the MVC subfolders i.e. for the "catalog" module:-

    M
    /catalog/model/catalog/category.php
    V
    /catalog/view/theme/default/template/product/category.tpl or /catalog/view/theme/second/template/product/category.tpl
    C
    /catalog/controller/product/category.php

    There may not be a need to read the database prefix as the data is available in the API.

    It would be helpful to know more about the nature of the "module" you are developing?

    Regards,

    Hackasacka
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 14 2018, 09:58 PM - #Permalink
    I don't know what sql file you are doing Martin, but there isn't any default prefix you could use for a module normally.

    Instead you should include a install.php in your package, which is used when you install your module, and in this you use:
    " . DB_PREFIX . "
    The reply is currently minimized Show
Your Reply