db.xml for single page

Permalink
How can one add a database table for a single page? I want to send out email from the module and when the mail is sent, I want it to record when the mail was sent out and then to produce a list of all the mail sent out reflecting the date the mail was sent.

 
digirunt replied on at Permalink Reply
digirunt
You could add it as a basic package, when a package is installed a db.xml is parsed and database tables are created accordingly

simple package structure can be

myPackage/controller/myPage.php
myPackage/single_pages/myPage.php
myPackage/db.xml
myPackage/controller.php

the controller in the package root simply contains install information

defined('C5_EXECUTE') or die(_("Access Denied."));
class HelloWorldPackage extends Package {
     protected $pkgHandle = 'hello_world';
     protected $appVersionRequired = '5.3.0';
     protected $pkgVersion = '1.0';
     public function getPackageDescription() {
          return t("Just an example package that says Hello World.");
     }
     public function getPackageName() {
          return t("Hello World");
     }
     public function install() {
          $pkg = parent::install();
          Loader::model('single_page');
          SinglePage::add('/myPage', $pkg);


more details are available here

http://www.concrete5.org/documentation/developers/system/packages...

hope this helps

-nat
mapwa replied on at Permalink Reply
Thanks Nat. I'm going to look at that and report back as soon as possible...

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.