XUpload Workflow

Comparing #4 with #5

Revision #5 was created by Asgaroth Asgaroth on Nov 8, 2012, 10:30:45 PM.

file hinting

Content

[...]
------------------
First we need to create the action that will show the form to the user:


```php
// application/controllers/FancyController.php
 
 
public function actionForm( ) {
$model = new SomeModel;
Yii::import( "xupload.models.XUploadForm" );
[...]
```php
// application/views/fancy/form.php
 
 
<fieldset>
<?php
$form = $this->beginWidget('CActiveForm', array(
[...]
```php
<?php
// application/controllers/FancyController.php
 
 
public function actionUpload( ) {
Yii::import( "xupload.models.XUploadForm" );
//Here we define the paths where the files will be stored temporarily
[...]
```php
<?php

 
// application/controllers/FancyController.php
 
 
public function actionForm( ) {
$model = new SomeModel;
Yii::import( "xupload.models.XUploadForm" );
$photos = new XUploadForm;
//Check if the form has been submitted
if( isset( $_POST['SomeModel'] ) ) {
[...]