首页 \ 问答 \ Yii - 从URL中消除模块的默认控制器ID(Yii - Eliminate default controller ID for a module from URL)

Yii - 从URL中消除模块的默认控制器ID(Yii - Eliminate default controller ID for a module from URL)

我创建了一个模块,里面有一个默认的控制器。 现在我可以在默认控制器中访问索引操作(默认操作),如/ mymodule /。 对于所有其他操作,我需要在url中指定控制器ID,如/ mymodule / default / register /。 我想知道是否可以从模块中的默认控制器的url中删除控制器ID。

我需要像这样设置网址规则:

before beautify : www.example.com/index.php?r=mymodule/default/action/

after beautify : www.example.com/mymodule/action/

注意:我希望这只发生在默认控制器上。

谢谢


I created a module and there exists a default controller inside that. Now I can access the index action (default action) in the default controller like /mymodule/. For all other action i need to specify the controller id in the url like /mymodule/default/register/ . I would like to know is it possible to eliminate the controller id from url for the default controller in a module.

I need to set url rule like this:

before beautify : www.example.com/index.php?r=mymodule/default/action/

after beautify : www.example.com/mymodule/action/

Note: I want this to happen only for the default controller.

Thanks


原文:https://stackoverflow.com/questions/9496869
更新时间:2023-10-26 21:10

最满意答案

我最终在objective c中实现了缺少的类,并使用它们来解决问题。


I finally implement missing classes in objective c and use them to solve the problem.

相关问答

更多
  • 您可以使用sqlighter ,这是一个兼容j2objc的库,可让您为Android和iOS编写一次数据库访问代码。 由于它将SQLite库包装在两个平台上,所以很容易切换。 如果您真的想实现自己的跨平台API,通常应用程序使用定义API的接口或抽象类,并且使用依赖注入框架(例如Dagger或Java反射)加载每个平台的单独实现。 使用你的代码作为起点,首先用一个抽象的executeSql()方法将SQLiteAdapter定义为一个抽象类: public abstract class SQLiteAdap ...
  • 要确定当前平台,请使用System.getProperty("os.name") 。 j2objc翻译的应用程序将返回“iPhone”,“iPhone模拟器”或“Mac OS X”。 要在Android和iOS上运行不同的代码,通常将接口或抽象类定义为共享代码使用的API,然后使用Android和iOS版本实现/子类。 您可以使用上面的os.name测试在运行时动态加载正确的类。 但是,如果Android和iOS版本之间的唯一区别是本机代码,则可以共享单个类。 因为OCNI本机代码片段在Java注释中,所以 ...
  • 考虑切换到SQLighter( https://github.com/vals-productions/sqlighter ),这是一个使用Android和iOS内置的本机SQLite库的Java ORM 。 由于支持本地平台,它既小巧又快速,而且通常可以更容易地将Java代码编写到ORM中,这需要更少的样板代码。 J2ObjC不支持JDBC,因为它对于移动应用程序来说是一个糟糕的选择(缓慢,笨重),数据库供应商不提供iOS版本的驱动程序。 从理论上讲,你可以通过移植JDBC来移植Xerial,但这是一个很 ...
  • kxml2包实现了javax.xml.parsers和org.xml.pull.v1工厂接口。 这些是您的应用程序应该用于任何XML解析的公共API。 你可以在j2objc的测试类以及一般的互联网搜索中找到如何访问和使用这些工厂的例子。 The kxml2 package implements the javax.xml.parsers and org.xml.pull.v1 factory interfaces. These are the public API your app should use f ...
  • 我最终在objective c中实现了缺少的类,并使用它们来解决问题。 I finally implement missing classes in objective c and use them to solve the problem.
  • j2objc明确不支持GUI代码; http://j2objc.org上的第一段说明: 目标是用Java编写应用程序的非UI代码(例如应用程序逻辑和数据模型),然后由Web应用程序(使用GWT),Android应用程序和iOS应用程序共享。 AFAIK,没有将Android UI转换为iOS的工具。 但是,有几个平台拥有自己的UI抽象,支持Android和iOS,例如Xamarin , Corona SDK和Apache Cordova(又名Phonegap) 。 GUI code is explicitl ...
  • Guava正在将其API升级到Java 8,因此开发人员需要一种方法来包含它的不同版本。 因此,Guava包含被移动到/ include / guava /,因此您需要将该路径添加到Header搜索路径。 Guava is in the process of upgrading its API to Java 8, and so developers need a way to include different versions of it. The Guava includes were therefo ...
  • 我认为最好的办法是实现Apache HttpClient CookieStore接口,以便它使用iOS NSHTTPCookieStorage类。 Like @tball said, this was fixed in j2objc 1.0.1.
  • 尝试在jsr305库(-ljsr305)中进行链接,因为它定义了上面引用的javax.annotation注释。 Try linking in the jsr305 library (-ljsr305), as it defines the javax.annotation annotations referenced above.
  • 根据我的经验,不是没有。 如果您查看转换页面 ,它表示它支持一部分反射功能来支持测试框架。 我正在使用j2objc 0.56。 如果我尝试调用方法: java.lang.reflect.Method method; try { method = biometry.getClass().getMethod(methodName, int.class, double.class); CalcResult r = (CalcResult) method ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。