I recently have been trying to learn Yii and PHP together.
I have hit a road block in my understanding. I see it works on the Trackstar example code from
"Agile Web Application Development with Yii 1.1 and PHP5"
I can not understand how an action like
<form id="project-form" action="/trackstar/index.p
<p class="note">Fields with <span class="required">*</span> are required.</p>
as the HTML rendered looks like the above
triggers a record creation. Could someone explain the program flow?
project is the projectController.php and create is the view involved but how does the actual
SQL command Insert .. $model data ... get executed?
Is the create view essential for the name? Do I have to override whatever other view name I use? Someone help me out here????
Does this happen via get and Post?? e.g after post then the data is saved
via the if(isset($_POST['Project']
May be I am right here has it been there the whole time.
1. call up url from menu or type into browser: to render the form as a get
press the submit button and go to the same URL but as a post -
call save funcion code within the parent of the model, CActivateRecord
Here is the actionCreate function:
public function actionCreate()
// Uncomment the following line if AJAX validation is needed
fwrite($fp0," Got 2 start of actionCreate");
fwrite($fp1," We Got POST SO WE ARE INSERTING DATA");
fwrite($fp," Got here to end");
In fact it makes sense that the parent class CActiveRecord of the model here contains the
save function which actually saves the data base record.
Can anyone comment on this finding? Maybe this will help others like myself