Yichun Zhang (章亦春) > OpenResty > OpenResty::Handler::CompiledView

Download:
OpenResty-0.5.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

OpenResty::Handler::CompiledView - Handler for pre-compiled views

DESCRIPTION ^

It loads compiled.views file from etc/ or /etc/openresty/ (in such an order).

A sample compiled.views looks like this:

    use OpenResty::QuasiQuote::SQL;
    {
        'yquestion|getquery' => [
            { _user => 'yquestion.Public' },
            sub {
                my ($openresty, $vars) = @_;
                #$resty->set_use
                my $query = $vars->{spell};
                return [:sql|select * from getquery($query) as (query text, pop integer, des text) limit 10 |];
            }
        ],
    }

AUTHOR ^

Agent Zhang (agentzh) <agentzh@yahoo.cn>

SEE ALSO ^

OpenResty::Handler::View, OpenResty::Handler::Role, OpenResty::Handler::Action, OpenResty::Handler::Feed, OpenResty::Handler::Version, OpenResty::Handler::Captcha, OpenResty::Handler::Login, OpenResty.

syntax highlighting: