Inserting PHP: Tutorial request

Hello,

Sorry to ask this here, but I’ve trawled the net and the KB and not found
anything useful, but I’m sure I’ve seen mention of a tutorial here.

What we’re looking for is a tutorial for me who knows FW and someone who is
a competent PHP coder but does not have a deep understanding of FW to help
know exactly what to put in where.

I’m sure I’ve seen something, but cannot find it.

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Peter,

this used to be easy to find on the Freeway site but I think since they redid the site it has got lost in with some other things as I just tried and couldn’t turn it up either, anyway…

The following link will take you to several examples of using php and php/MySQL with Freeway, there are example files you can download and dump files for anything that uses a database.
http://www.easibase.com/freeway/phpmysql.php

HTH
Mike


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry… should have said: ‘on the softpress site’ :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

on 15/04/2009 13:33, Mike B at email@hidden wrote:

Hi Peter,

this used to be easy to find on the Freeway site but I think since they redid
the site it has got lost in with some other things as I just tried and
couldn’t turn it up either, anyway…

The following link will take you to several examples of using php and
php/MySQL with Freeway, there are example files you can download and dump
files for anything that uses a database.
Easibase: PHP/MySQL With Freeway

HTH
Mike

Hi Mike, many thanks for the link and the work you’ve put into producing the
examples.

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ve written about this at length before, but I can’t lay my fingers
on an example of the breed. I’ll try to summarize.

For you:

Server-side code runs on the server, before the visitor’s browser ever
sees the page. The output of well-written code is plain HTML, but
custom HTML that includes the result of the code being interpreted by
the server. What goes in is not the same as what goes out. (By the
way, the output of poorly-written code is an error message or a blank
page, depending on whether your server is in development or production
mode.)

When you design in Freeway, you GENERATE code, and each time you
change your design, the HTML code from Freeway is thrown out and re-
created from scratch. What this means to you is you cannot throw your
published code “over the wall” to your developer and have them edit it
and call it done – unless you plan never to make any changes to your
design again.

This means you have to be a little smarter than the average code-
monkey using Dreamweaver, and you need to think ahead about how to
work with your developer to get the code into your Freeway document,
where it will become part of the object-oriented design model of the
site.

For the developer:

Freeway GENERATES tidy, well-written, standards-compliant (X)HTML.
It does so by interpreting a design model of the entire site (a model
which has more in common with desktop-publishing applications like
InDesign or QuarkXPress than any text-oriented code-editor-in-heels
like Dreamweaver) and converting that model at publish time into the
most efficient layout structure it can calculate. When the designer
moves something on the page – even by one pixel in any direction –
the entire page and all who sail in it are deleted and re-generated,
so as never to miss a trick, layout-wise. The finished code will
render more or less identically in any browser from IE5.5 on up to
Firefox 3.5, on all major platforms. (Windows IE-specific stylesheet
“shims” are injected using conditional comments to account for IE’s
lack of standards support.)

There are “nooks and crannies” everywhere within a Freeway page where
custom code may be added, plus there is a general-purpose Markup Item
design element which your designer may use (as many times as
necessary) to inject raw code or template tokens into the layout with
pixel precision.

Freeway also includes a rich plug-in model called Actions. These are
written in a mixture of XML and JavaScript, and allow absolute control
over the publishing model and the output code. For more information
about Actions, visit http://ActionsForge.com

There are two basic ways to work with a Freeway page from a coder’s
perspective: Outside-in and Inside-out.

For the former, give your designer a list of replacement tokens in
your favorite template language, and if you need to, a list of
filenames to follow for naming the templates. The designer will enter
those tokens either as styled text or as properties (page title, etc.)
in the Page Inspector. You will consume and parse the resulting html
template and deliver the merged product.

For inside-out, you will need to gather your code into a library which
may be included into the top of each page that needs dynamic
attention. Freeway can set any filename (extension) you like for its
published pages, so you can create a merged code and layout page if
you like. There is an Action to include up to 20 files into a page and
write a proper include statement in PHP for each. These files are then
managed by Freeway – checked for version – and uploaded if necessary
due to changes. So in order to update the code, pass a revised version
of your library back to your designer, and ask him or her to replace
their current copy.

Instruct your designer how to mark up a code replacement snippet, like
maybe <?=$foo?>, Give the designer a list of these snippets (defined
or calculated in your library code) and indicate where they need to go
on the page. For repeating table rows, ask your designer to lay out a
header and single data row, and ask him or her to use the Extend
button in the Table Inspector to add a set of loop code that generates
the TRs as long as there is data. You will need to supply the entire
TR’s worth of code, or your designer will need to use the
TemplateHelper Action to define a single TR as a template ‘partial’
which you will consume and populate within your loop.

Hope this helps,

Walter

On Apr 15, 2009, at 8:20 AM, Peter Tucker wrote:

Hello,

Sorry to ask this here, but I’ve trawled the net and the KB and not
found
anything useful, but I’m sure I’ve seen mention of a tutorial here.

What we’re looking for is a tutorial for me who knows FW and someone
who is
a competent PHP coder but does not have a deep understanding of FW
to help
know exactly what to put in where.

I’m sure I’ve seen something, but cannot find it.

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options