Chapter 2.3: Project

Let project’s Model.pm inherit from Genelet::Model, so you can put project-wide settings, like database type, pagination and common methods, into project’s Model.pm. Let component’s Model.pm inherit from that of project.  So, all the components will share the same project settings.

In this example, the project is named Myproject.

package Myproject::Model;

use strict;
use Genelet::Model;

use vars qw(@ISA);
@ISA = qw(Genelet::Model);

__PACKAGE__->setup_accesors(
  'sortby' => 'sortby',
  'sortreverse' => 'sortreverse',
  'field' => 'field',
  'empties' => 'empties',
  'rowcount' => 'rowcount',
  'pageno' => 'pageno',
  'totalno' => 'totalno',
  'max_pageno' => 'max_pageno',
  'total_force' => 1
);

1;

So the pagination information is setup for the whole project. You can add project-wide methods here so they are available in all inherited classes.