让我们说我们在
somesite.com/mail
Run Code Online (Sandbox Code Playgroud)
这意味着我们正在使用名为'mail'的控制器.这个控制器有功能:
public function index(){
$this->load->view('header');
$this->load->view('mail/contact_form');
$this->load->view('footer');
}
Run Code Online (Sandbox Code Playgroud)
刚输入地址栏时会加载此功能
somesite.com/mail
Run Code Online (Sandbox Code Playgroud)
并按Enter键(无其他参数).让我们看一下contact_form视图的第一行:
<form role="form" method="post" action="sendmail">
Run Code Online (Sandbox Code Playgroud)
那是我的问题.当我在末尾用反斜杠键入地址时,如下所示:
mysite.com/mail/
Run Code Online (Sandbox Code Playgroud)
并使用我的联系方式,一切正常,我的邮件控制器加载函数sendmail和URL现在:
mysite.com/mail/sendmail/
Run Code Online (Sandbox Code Playgroud)
但是当我忘记反斜杠(mysite.com/mail)时,它会找到名为"sendmail"的控制器,但我不想要它.我的网址是:
mysite.com/sendmail
Run Code Online (Sandbox Code Playgroud)
但我当然没有任何名为sendmail的控制器.我的问题是 - 如何改变我的公式的行动或我该怎么做才能使这个工作得好?唯一的答案是记住反斜杠或什么?
我在这里寻求帮助.
我的课
LevelEditor
Run Code Online (Sandbox Code Playgroud)
有这样的功能:
bool SetSingleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
bool SetDoubleMast(Game*, GameArea*, GameArea*, vector<IShip*>*);
...
Run Code Online (Sandbox Code Playgroud)
在main.cpp中,我想创建一个指向LevelEditor对象函数的指针数组.我正在做这样的事情:
bool (*CreateShips[2])(Game*, GameArea*, GameArea*, vector<IShip*>*) =
{LevelEdit->SetSingleMast, LevelEdit->SetDoubleMast, ...};
Run Code Online (Sandbox Code Playgroud)
但它给了我一个错误:
error C2440: 'initializing' : cannot convert from 'overloaded-function' to
'bool (__cdecl *)(Game *,GameArea *,GameArea *,std::vector<_Ty> *)'
with
[
_Ty=IShip *
]
None of the functions with this name in scope match the target type
Run Code Online (Sandbox Code Playgroud)
我甚至不知道它是什么意思.有人能帮助我吗?
我对页面上的圆角元素有疑问.例如,我有一个不圆的小徽标,我想把它放在圆形背景(120x120).像这样制作div更好吗:
border-radius: 100%;
background-color: red;
background-image: url('logo.png');
background-position: center;
Run Code Online (Sandbox Code Playgroud)
或者只是为例如创建一个图像.瘸子?