帮助在编程时思考 MVC
我正在尝试将我创建的这个应用程序转换为 MVC 风格。 这是我的原始来源:
下面是我尝试将上述源创建到 MVC 中
我的问题:
- 我不明白如何从 另一堂课。我尝试制作 每个类下的“_init _”来调用模型、视图或控件。很遗憾 我遇到了这个错误: 运行时错误:超出最大递归深度
- 我想也许可以把我的 将数据放入字典,但我没有 知道我是否正确创建了它。 上面尝试的 MVC 源有 我也指的是字典。
- 我认为最后一件事是在我的来源中 可以有两种方式。如果“y”确实如此 如果“n”做了其他事情。 我该如何让我的 控制器从那些切换, 会是这样的吗: http://pastebin.com/Z9pp1L3g
有人可以查看我的 MVC 源代码并指导我完成此任务。
谢谢
I am trying to convert this application i created into MVC style.
This is my original source:
Below is my attempt to create above source into MVC
My issues:
- I don't understand how to call from
another class. I tried making
"_init _" under each class to call model, view or control. Unfortunately
i ran into this error:
RuntimeError: maximum recursion depth exceeded - I thought about maybe turning my
data into dictionaries but i don't
know if i am creating that correctly.
The attempted MVC source above has
the dictionaries i am referring too. - last thing is in my source my view
can go two ways. If "y" does
something if "n" does something else.
How do i go about letting my
controller switching from those,
would it be something like this:
http://pastebin.com/Z9pp1L3g
Can someone look at my MVC source and guide me to completing this task.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 MVC 的应用程序:
http://pastebin.com/0CiTqiwu
我非常接近完成这项任务。我把它改为
:
在我在同事的帮助下将其更改为后,脚本结果完美运行。操作将简单的tcpdump脚本转为MVC风格,成功!
谢谢大家的帮助~
My Application using MVC:
http://pastebin.com/0CiTqiwu
I was rather close in completing this task. I had it as
instead of:
Which after i changed it to that with the help of a co-worker, the script turned out to work perfect. Operation turn simple tcpdump script to MVC style, Success!
Thanks everyone for the help~