App-ZofCMS
view release on metacpan or search on metacpan
lib/App/ZofCMS.pm view on Meta::CPAN
package App::ZofCMS;
use warnings;
use strict;
our $VERSION = '1.001008'; # VERSION
1;
__END__
=encoding utf8
=head1 NAME
App::ZofCMS - web framework and templating system for small-medium sites.
=head1 SYNOPSIS
This module is just the main documentation for ZofCMS framework. See
L<USING THE FRAMEWORK> section below for explanation of how to use this
framework.
=head1 WARNING
=for html <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;">
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 L<Mojolicious>. For that reason,
I strongly recommend you do NOT use this framework. Please see
L<Mojolicious>, L<Catalyst>, L<Dancer>, or L<Dancer2> as alternatives.
=for html </div></div>
=head1 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 L<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 L<App::ZofCMS::Plugin> namespace or email it to me (C<zoffix@cpan.org>)
and I will package it, upload it, and give you corresponding credits.
ZofCMS currently uses L<HTML::Template> as a module to interpret HTML
templates. And so far, I have no plans to change this to anything alike
L<Template::Toolkit>.
Despite the "core" of the framework along with all of its plugins being
on CPAN there is a helper script (C<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
C<perldoc zofcms_helper>.
=head1 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 C<#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 L<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
uploads to that site. No, it wasn't hard to add them, it's just that
I found myself adding a couple lines of code to the "core" modules that
called modules which provided new functionality and those modules were
lib/App/ZofCMS.pm view on Meta::CPAN
cares about from that directory. B<Note:> make sure to remove the line
C<use CGI::Carp qw/fatalsToBrowser/;> from C<index.pl> before deploying
your finished site live. See C<CGI::Carp> for more information.
The C</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 C<data> directory you will notice a file called C<base.tmpl> this
is the "base" L<HTML::Template> file, it will be filled with virtually
all the keys from ZofCMS template. In the C<templates> directory you will
find C<index.tmpl> and C<404.tmpl>
B<Before we proceed any further> I advise you to read documentation
for L<App::ZofCMS::Config> and L<App::ZofCMS::Template> as I am not going
to explain what each key means; it is explained in aforementioned
documentation in detail.
=head2 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 L<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 C<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 C<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 C<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/
=head1 REPOSITORY
=for html <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;">
Fork this module on GitHub:
L<https://github.com/zoffixznet/App-ZofCMS>
=for html </div></div>
=head1 BUGS
=for html <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;">
To report bugs or request features, please use
L<https://github.com/zoffixznet/App-ZofCMS/issues>
If you can't access GitHub, you can email your request
to C<bug-App-ZofCMS at rt.cpan.org>
=for html </div></div>
=head1 AUTHOR
=for html <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;">
=for html <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%2F627d83ef9879f31bda...
=for html </div></div>
=head1 LICENSE
You can use and distribute this module under the same terms as Perl itself.
See the C<LICENSE> file included in this distribution for complete
details.
=cut
( run in 1.846 second using v1.01-cache-2.11-cpan-d8267643d1d )