Hi all
I’m newbie using yii
I got a tutorial where we want to display the famous ‘HELLO WORLD’
As you can guess we don’t need any DB to do this.
How can I create the views,forms without having a model?
Thanks
Hi all
I’m newbie using yii
I got a tutorial where we want to display the famous ‘HELLO WORLD’
As you can guess we don’t need any DB to do this.
How can I create the views,forms without having a model?
Thanks
It’s not difficult. In your controller
in controllers/PageController.php
public function actionIndex(){
$this->render('index');
}
and in views/index.php you can simply do:
Hello World!
Btw, you don’t need a form to do this…
[quote=“zitter, post:2, topic:24714”]
It’s not difficult. In your controller
in controllers/PageController.php
public function actionIndex(){
$this->render('index');
}
and in views/index.php you can simply do:
Hello World!
Thanks for your reply
What I was trying to do was to follow a tutorial to see how yii works from the beginning to the end.
This Tutorial
http://www.sterlingsavvy.com/tutorials/index.php?t=1&l=1
So in the part to create controlller , views, etc it does not say anything about it.
Thanks again
If not done yet, you should read about the two main concepts: OOP and MVC. For both you should find tons of material on the net. Once mastered you’ll see, that Yii feels very natural.