App-ZofCMS

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

# NAME

App::ZofCMS - web framework and templating system for small-medium sites.

# SYNOPSIS

This module is just the main documentation for ZofCMS framework. See
["USING THE FRAMEWORK"](#using-the-framework) section below for explanation of how to use this
framework.

# WARNING

<div>
    <div style="display: table; height: 91px; background: url(http://zoffix.com/CPAN/Dist-Zilla-Plugin-Pod-Spiffy/icons/section-warning.png) no-repeat left; padding-left: 120px;" ><div style="display: table-cell; vertical-align: middle;">
</div>

I have no desire to continue development or maintenance of this framework.
As far as I know, I am the only developer. My only ties to this
framework is its use at $work and I am actively trying to switch
to [Mojolicious](https://metacpan.org/pod/Mojolicious). For that reason,
I strongly recommend you do NOT use this framework. Please see
[Mojolicious](https://metacpan.org/pod/Mojolicious), [Catalyst](https://metacpan.org/pod/Catalyst), [Dancer](https://metacpan.org/pod/Dancer), or [Dancer2](https://metacpan.org/pod/Dancer2) as alternatives.

<div>
    </div></div>
</div>

# DESCRIPTION

ZofCMS stands for "Zoffix's Content Management System", however I prefer
it to be just a name. It is a small web framework/templating system designed
to be easily installed and workable on limited severs, i.e. the ones that do
not allow you to install perl modules from CPAN, don't have ssh and
occasionally don't even offer any SQL databases. If you have more freedom
than that you may want to give [Catalyst](https://metacpan.org/pod/Catalyst) a try which, my opinion, is
a great framework, not just for web, and it offers far more functionality
than ZofCMS ever will.

ZofCMS is plugin based. If you create your own plugins, please upload them
to [App::ZofCMS::Plugin](https://metacpan.org/pod/App::ZofCMS::Plugin) namespace or email it to me (`zoffix@cpan.org`)
and I will package it, upload it, and give you corresponding credits.

ZofCMS currently uses [HTML::Template](https://metacpan.org/pod/HTML::Template) as a module to interpret HTML
templates. And so far, I have no plans to change this to anything alike
[Template::Toolkit](https://metacpan.org/pod/Template::Toolkit).

Despite the "core" of the framework along with all of its plugins being
on CPAN there is a helper script (`zofcms_helper`) which can produce
a ready-for-upload set of files which you can simply upload to your server
without having to install anything from CPAN on the server itself. See
`perldoc zofcms_helper`.

# HYSTORY

This section does not say anything useful, you can skip it if you are
not interested in what made me create ZofCMS.

For about two-three years name "ZofCMS" lived more as a joke. A lot of
people in IRC channels such as `#css` would ask me what web framework
I use (I didn't use any at the time) and I would gladly say "I use ZofCMS"
instead of the expected "Drupal" or "Wordpress".

After coding a templating system from scratch for
one of the sites, which runs on the server without any SQL, ssh
or ability to install any perl modules directly from CPAN, I already felt
that something needed to be done. The "perl hashref" templates which I used
to make all those products displayed with only one [HTML::Template](https://metacpan.org/pod/HTML::Template)
template proved to be flexible, extendable and maintainable and that's
exactly from where ZofCMS template format came.

The last site I coded before starting to implement ZofCMS was a private
web application which had a message board along with a few other features.
Mostly everything was coded from scratch once more... The final breaking
point when a few weeks later I was asked to add two sections for file

README.md  view on Meta::CPAN

`use CGI::Carp qw/fatalsToBrowser/;` from `index.pl` before deploying
your finished site live. See `CGI::Carp` for more information.

The `/var/www/testsite/web_site/` has more goodies in it. Here is what we
have in here:

    data        - here you would put your HTML::Template templates which
                  can be references from ZofCMS templates.

    templates   - here is where you would put your ZofCMS templates.

    ZofCMS      - this is where ZofCMS "core", its plugins and
                  any "template exec modules" (more on that later)
                  will live.

In the `data` directory you will notice a file called `base.tmpl` this
is the "base" [HTML::Template](https://metacpan.org/pod/HTML::Template) file, it will be filled with virtually
all the keys from ZofCMS template. In the `templates` directory you will
find `index.tmpl` and `404.tmpl`

**Before we proceed any further** I advise you to read documentation
for [App::ZofCMS::Config](https://metacpan.org/pod/App::ZofCMS::Config) and [App::ZofCMS::Template](https://metacpan.org/pod/App::ZofCMS::Template) as I am not going
to explain what each key means; it is explained in aforementioned
documentation in detail.

## FIRST PAGE

Now, let's create our first page. Let it be named something original,
like "foo" :)

Open up your config file and under valid pages add '/foo'. Considering
you \*did\* read documentation for [App::ZofCMS::Config](https://metacpan.org/pod/App::ZofCMS::Config) you'll know exactly
what to do at this point.

now go to your "core dir" (which will be /var/www/testsite/web\_site/
if you followed (and able to execute) the helper script example from
INITIAL SETUP section above. Go to to directory "templates" and create
a file named `foo.tmpl`, in that file enter the following:

    {
        title       => 'Hello World',
        body        => \'foo.tmpl',
        t           => {
            cur_time => scalar(localtime),
        }
    }

Now go to "data directory" and create a new file named `foo.tmpl` and
enter the following into it:

    <p>Current time is: <tmpl_var name="cur_time">

Providing you did not edit anything else in your config file and did not
touch `base.tmpl` file in your "data directory" you can now access
your web application and see a page which will display current time.
How wonderful \\o/

# REPOSITORY

<div>
    <div style="display: table; height: 91px; background: url(http://zoffix.com/CPAN/Dist-Zilla-Plugin-Pod-Spiffy/icons/section-github.png) no-repeat left; padding-left: 120px;" ><div style="display: table-cell; vertical-align: middle;">
</div>

Fork this module on GitHub:
[https://github.com/zoffixznet/App-ZofCMS](https://github.com/zoffixznet/App-ZofCMS)

<div>
    </div></div>
</div>

# BUGS

<div>
    <div style="display: table; height: 91px; background: url(http://zoffix.com/CPAN/Dist-Zilla-Plugin-Pod-Spiffy/icons/section-bugs.png) no-repeat left; padding-left: 120px;" ><div style="display: table-cell; vertical-align: middle;">
</div>

To report bugs or request features, please use
[https://github.com/zoffixznet/App-ZofCMS/issues](https://github.com/zoffixznet/App-ZofCMS/issues)

If you can't access GitHub, you can email your request
to `bug-App-ZofCMS at rt.cpan.org`

<div>
    </div></div>
</div>

# AUTHOR

<div>
    <div style="display: table; height: 91px; background: url(http://zoffix.com/CPAN/Dist-Zilla-Plugin-Pod-Spiffy/icons/section-author.png) no-repeat left; padding-left: 120px;" ><div style="display: table-cell; vertical-align: middle;">
</div>

<div>
    <span style="display: inline-block; text-align: center;"> <a href="http://metacpan.org/author/ZOFFIX"> <img src="http://www.gravatar.com/avatar/328e658ab6b08dfb5c106266a4a5d065?d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2F627d83ef9879f31bdabf448e66...
</div>

<div>
    </div></div>
</div>

# LICENSE

You can use and distribute this module under the same terms as Perl itself.
See the `LICENSE` file included in this distribution for complete
details.



( run in 1.872 second using v1.01-cache-2.11-cpan-f56aa216473 )