Fabrik User Manual 0



Yüklə 1,97 Mb.
Pdf görüntüsü
səhifə4/24
tarix17.09.2018
ölçüsü1,97 Mb.
#69275
1   2   3   4   5   6   7   8   9   ...   24

E.g. my url is :
http://test.com?users___id=62
and I wanted to load the email address for
the user who's id is 62 my placeholder
would be:
{$this->users___id->email}
{$mosConfig_absolute_path}
Replaced with the constant JPATH_SITE -
this is the server path to your site .e.g.
/var/www/html/mysite
{$mosConfig_live_site}
Replaced wth JURI::base(), this is the url
of your site.e.g. http://mysite.com
{$mosConfig_offset}
The site's timezone offset
{$Itemid}
The current menu item's Itemid
{$mosConfig_sitename}
The site's name
{$mosConfig_mailfrom}
The global "email from" option
{where_i_came_from}
The URL of the previous page (HTTP
referrer)
{$_SERVER->xxx}
Replace xxx with any varaible found in
PHP's $_SERVER global see here for a full
list
http://php.net/manual/en/
reserved.variables.server.php
{session.token}
Will be replaced with the current Joomla
session token
{new:Some text}{edit:Some edit text}
Used on form intro fields, when adding a
new record the text "Some text" will be
displayed. When editing a record the text
"Some edit text" will be displayed
{thistable}
only available in database join concat and
where fields - is replaced with the joins
table name
URL structure
To open a table in your browser you should use this URL, replacing 'X' with the table id
you want to display:
index.php?option=com_fabrik&view=table&tableid=X
To view a form in your browser you should use this URL, replacing 'X" with the form id
you want to display:
index.php?option=com_fabrik&view=form&fabrik=X
If you want to load a specific row for editing then use this url, replacing 'Y' with the
10


rows's id:
index.php?option=com_fabrik&view=form&fabrik=X&rowid=Y
To view a detailed view of the same row, replace the view variable, 'form' with 'details':
index.php?option=com_fabrik&view=details&fabrik=1&rowid=1
For any of these URL's you can add '&fabrikdebug=1' to the end of the URL. This will
provide you with some debug output of what Fabrik is doing. This only occurs when you
have set 'allow fabrik debug' on in Fabrik's global parameters.
Design strategy
Create applications in Fabrik (and in a larger context designing a database) can be a fun
and rewarding exercise.... or can be a series of frustrations.
Lets imagine that we want to make a shop application.
The key to success is planning, so first of all - turn off your computer, get out a pencil
and some paper. Having a diagram of what you want to achieve in is indispensable and
will save you hours of frustration later down the line as it forces you to make decisions
about your application before you start building it - a pencil and a rubber are so much
faster that getting half way through your application before you realize that a
fundamental mistake has been made.
Now with your drawn diagram you are going to try to describe what objects and
relationships you are going to have in your application.
Objects
Objects are fairly straight forward, the are things like "products", "customers",
"manufacturers" and "orders", any noun in your model can be thought of as an object.
Often when we think more about these objects we realize that they contain other
objects. Customers contain "addresses" (they could have a credit card address AND a
different delivery address). Orders are actual made up of "Order items" - each product
that the customer has placed with any given order.
So break down these objects as far as they will go. Then on your piece of paper draw a
box labelled accordingly for each object.
Relationships
Relationships are a little more abstract and take a little more thought about how we
want our application to work. Rather than nouns, relationships are verbs.
At their simplest they are defined by drawing a line from one object's box to another - so
we could draw a line from products to manufacturers, which would indicate that a
product is created by a manufacturer. Note how "created by" is a verb and hence a
relationship.
In this example a product is created by ONE manufacturer and manufacturers can create
MANY products. This type of relationship is know as a "one to many" relationship and can
11


often be created in Fabrik by use of a database join element, or by adding a join to the
Fabrik table.
Now taking our shop example, lets say that "products" can go in "categories" BUT that
any single product can be assigned to multiple categories. This is a "many to many"
relationship and thus we need to create a table for it. This table will have a field to store
the productid and another to store the categoryid.
I tend to name these types of tables "product_categories" as its name describes the
relationship it is modelling. A component like Virtuemart has a similar naming convention
but adds "_xref" to the end of the table name.
This thought process is referred to as database normalization - here's some further
reading on it:

http://www.troubleshooters.com/littstip/ltnorm.html

http://en.wikipedia.org/wiki/Database_normalization
Some of our tutorials that deal with modelling these relationships are:

Joining some data

One to Many relationships

Many to many relationships

Related data
Forms
Forms are the heart of Fabrik, they allow you to collect data from users to access your
data for editing and viewing.
To access the form's section select components->fabrik->forms. You will see a page
containing a list of your forms similar to the diagram below:
Each form can be selected with the check box to the left of its name. Once selected it
can be altered by clicking on the buttons in the top right hand corner:
• Publish - sets the state of the form to published (note that the form's start and
end publish dates still need to be correctly set up for the form to be visible to
your users)
• Unpublish - sets the form's state to unpublished
• Copy - copies the form
12


Yüklə 1,97 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   ...   24




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə