ドキュメントを調べましたが、URI をモジュールにルーティングする方法がわかりません。
私のモジュールには現在、正しいディレクトリ構造を使用する単一のコントローラーが含まれています(現在、空のディレクトリがたくさんあります)。内部にコントローラーがあり、内部modules/module_name/classes/controller
にルートファイルがありますmodules/module_name/config/routes.php
。
と の両方/app/config/routes.php
でmodules/module_name/config/routes.php
次のことを試しました。
<?php
return array(
'_root_' => 'md5_encrypt/index', // The default route
'tools/geek/md5_encrypt' => array('md5_encrypt'),
);
コントローラーは次のようになります (ただし、関連性はないと思います)。
<?php
/**
* MD5 Encrypt Controller.
*
* Online tool to encrypt a string using MD5
*
* @package app
* @extends Controller
*/
namespace Md5_encrypt;
class Controller_Md5_Encrypt extends Controller_Template
{
/**
* The tool
*
* @access public
* @return Response
*/
public function action_index()
{
$data = array();
$this->template->tab = 'geek';
$this->template->title = 'MD5 Encrypt Tool';
$this->template->content = View::forge('welcome/index', $data);
}
}