Tripletail::Filter::Redirect - リダイレクトヘッダ出力
$TL->setContentFilter( 'Tripletail::Filter::Redirect', location => 'http://example.org/');
あるいは
$TL->location('http://example.org/');
以下の処理を行う。
$TL->location は、出力フィルタをこのクラスに 設定する為のユーティリティーメソッドである。
リダイレクト先のURLを指定する。
my $SAVE = $filter->getSaveForm;
出力フィルタが所持している、保存すべきデータが入った Form オブジェクトを返す。
$filter->setDecideLink(\&func);
リンク種別を決定する関数を設定する。 値を渡さないとデフォルトの判別処理に戻す。
関数の戻り値が1であれば、同じTLライブラリで作成された環境へのリンクとして、リンクの書き換えを行う。 関数の戻り値が0であれば、リンクの書き換えは行わない。
デフォルトの判別処理は以下の関数で行っている。
sub defaultDecideLink { my (%param) = @_; if($param{'link'} =~ m/^https?/) { return 0; } elsif($param{'link'} =~ m/^javascript/i) { return 0; } elsif($param{'link'} =~ m/^(?:mailto|ftp):/) { return 0; } elsif(not length $param{'link'}) { return 0; } else { return 1; } }
$filter->setHeader($key => $value)
他の出力の前に実行する必要がある。 同じヘッダを既に出力しようとしていれば、そのヘッダの代わりに指定したヘッダを出力する。(上書きされる)
$filter->addHeader($key => $value)
他の出力の前に実行する必要がある。 同じヘッダを既に出力しようとしていれば、そのヘッダに加えて指定したヘッダを出力する。(追加される)
Tripletail::Filter参照
Copyright 2006 YMIRLINK Inc. All Rights Reserved.
This framework is free software; you can redistribute it and/or modify it under the same terms as Perl itself
このフレームワークはフリーソフトウェアです。あなたは Perl と同じライセンスの 元で再配布及び変更を行うことが出来ます。
Address bug reports and comments to: tl@tripletail.jp
HP : http://tripletail.jp/
To install Tripletail, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tripletail
CPAN shell
perl -MCPAN -e shell install Tripletail
For more information on module installation, please visit the detailed CPAN module installation guide.