Hi all,

I'm having trouble with my view subroutines for classes. If I
create/override them in MyApp.pm as below, every thing works fine.

{
package MyApp::Courses;

    sub list :Exported {
        my ( $class, $r ) = @_;
        my $order = $class->order($r);
        $class = $class->do_pager($r);
        if ($order) {
            $r->objects( [ $class->retrieve_from_sql( qq/is_visible =
1 AND (is_cancelled < 1 OR is_cancelled IS NULL) AND date >= CURDATE()
ORDER BY $order, date/ ) ] );
        }
        else {
            $r->objects( [ $class->retrieve_from_sql( qq/is_visible =
1 AND (is_cancelled < 1 OR is_cancelled IS NULL) AND date >= CURDATE()
ORDER BY date/ ) ] );
        }
        $r->{template_args}{featured} = [
ITACRegistration::Courses->retrieve_from_sql( qq/is_visible = 1 AND
(is_cancelled < 1 OR is_cancelled IS NULL) AND featured = 1 AND date
>= CURDATE() ORDER BY date/ ) ];
    } ## end sub list :

}

If I try to insert the same subroutine, though in the MyApp/Courses.pm
file, where the docs say the declarations should go, I get errors
about "symbol :Exported not recognized" and "can't use global @_ in
subroutine."

I'm perplexed.

TIA

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to