Before writing some piece of code here, i try to explain file hierarchy of our application so it will be easy to understand i think.
Our application's web pages are under application_directory/protected/pages. Our application's configuration file is application_directory/protected/application.xml.
Our web pages are consisted from 2 files, one page file and one php file. It's good for the ones whom really get used to write ASP.Net codes. Because all the html and php codes will be separated so. We write our php code's to php file and write html codes to html file. In order to attain to html page from our php code we use Prado's components. For example if we want to put a textbox on our html page and want to change it's value by clicking a button;
We first define a text box and a button component at our page;
<com:TForm>
<com:TTextBox id="textbox" />
<com:TButton Text="Try" OnClick="changeTextBoxValue" />
</com:TForm>
The text box must be defined within form tag, if it's not, prado will throw an exception about it.
Now we define our function that our button component calls when it'll be clicked in our php page.
public function changeTextBoxValue(){
$this->textbox->Text = "Hello";
}
also this function must be within our page class that is inherited from Prado's TPage.
class Home extends TPage{
}
This is going to be a Prado tutorial so i want to end it here and want to write some useful bunch of codes about Prado. If you want to go with tutorials, this will be the point to it. Also here is the code we write down up there. To run the code Prado must be at same place where the project code is.
Subscribe to:
Post Comments (Atom)
.bmp)
No comments:
Post a Comment