如何使用 php yii 将 url 定向到控制器

问题描述

我创建了名为 TourItemController.PHP 的控制器。在这个控制器中,我有一个名为 actionCreate 的函数

另外,我在 backend/views/tour/addtour.PHP 中有 addtour.PHP。问题是我想引导用户到 addtour.PHP 页面并填写表格。因为我配置了创建功能用户输入的数据将被保存到数据库中。我不确定正确的 url 部分

<a href="<?PHP echo Url::to(['tour-item/create']); ?>" class="btn btn-app">Click here to add tour item
    </a>

TourItemController.PHP

class TourItemController extends Controller
{
public function actionCreate($id)
{
    $cityes = ArrayHelper::map(City::find()->all(),'id','name');
    $destinations = ArrayHelper::map(Destination::find()->all(),'title');
  .  
  .
  .
  goes like that }}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)