how to direct url to controller with php yii
Get the solution ↓↓↓I created controller which is called TourItemController.php. In this controller I have function called actionCreate.
Also, I have addtour.php in backend/views/tour/addtour.php. The thing is that I want to direct the user to addtour.php page and fill the forms. SД°nce I configured the create function, the data that the user was entered will be saved into the database. I am not sure what to the right url part
<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(),'id','title');
.
.
.
goes like that }}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: string literal contains an unescaped line break
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.