Yii Framework Forum: Tutorial Yii Framework - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

Tutorial Yii Framework Rate Topic: ***** 1 Votes

#81 User is offline   The Mentor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 27-March 13

Posted 27 March 2013 - 07:11 AM

Salam buat akang-akang semua,
Saya mau nanya mas,gimana cara hubungin form log in yang di my web application ke database & my sql ?
(saya make xampp mas)..
#thanks before
0

#82 User is offline   julianz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 17-April 13

Posted 25 April 2013 - 09:32 AM

dao tadi blum terjawab ? help me
0

#83 User is offline   Devi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 17-June 13
  • Location:Depok, Jawa Barat Indonesia

Posted 17 June 2013 - 03:53 AM

mau nanya kenapa photo yg di upload ga masuk ke db ya?? klo ke folder images.a masuk, tapi reload browser.a munculnya Error 404
The requested page does not exist.
scriptnya ky gini:

public function actionCreate() {
$model = new Gallery;
if (isset($_POST['Gallery'])) {
$model->attributes = $_POST['Gallery'];
$model->photo = CUploadedFile::getInstance($model, 'photo');

if (!empty($model->photo)) {
$path = Yii::getPathOfAlias('webroot') . Yii::app()->params->folder_gallery . $model->photo;

$path_thumb = Yii::getPathOfAlias('webroot') . Yii::app()->params->folder_gallery_thumb . 'thumb_' . $model->photo;
$model->photo->saveAs($path);
$thumb = Yii::app()->phpThumb->create($path);
$thumb->resize(428, 428);
$thumb->save($path_thumb);
}

if ($model->save())
$this->redirect(array('view', 'id' => $model->id));
}

$this->render('create', array(
'model' => $model,
));
}

mohon bantuan semuanya :)
saya msh newbie,,,
o iyaa saya di viewnya tdk menggunakan CFormModel, apakah bisa???
0

#84 User is offline   zabaleta10 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 09-July 13
  • Location:Earth

Posted 15 July 2013 - 01:09 PM

permisi master master semua
ane bikin web, supaya bisa dijalankan di server tempat kita naro aplikasinya gmn yah ? apa aplikasi dan folder yii dijadiin satu semua ato gmn ?
simple and smart
0

#85 User is offline   kalion 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 31-July 13

Posted 04 September 2013 - 10:58 AM

ini contoh pake DAO


ini di modelnya :
    /*listing vendor*/
    public function listVendor()
    {
        $arrvendor = array();
                
        //loop through vendor first
        $connection=Yii::app()->db;
        
        $ssi_query = "select * from ssi_vendor order by vendor_id";
        $ssi_result = $connection->CreateCommand($ssi_query)->query();
        
        $i=1;
        foreach($ssi_result as $ssi_fetch)
        {
            $vid = $ssi_fetch["vendor_id"];
            $vname = $ssi_fetch["vendor_name"];
            
            // put in array
            $arrvendor[$i]["seq"]=$i;
            $arrvendor[$i]["id"]=$vid;
            $arrvendor[$i]["name"]=$vname;
            
            // get raw material code
            $item[] = $this->getRawName($ssi_fetch["vendor_raw_material_1_code"]);
            $item[] = $this->getRawName($ssi_fetch["vendor_raw_material_2_code"]);
            $item[] = $this->getRawName($ssi_fetch["vendor_raw_material_3_code"]);
            $item[] = $this->getRawName($ssi_fetch["vendor_raw_material_4_code"]);
            $item[] = $this->getRawName($ssi_fetch["vendor_raw_material_5_code"]);
            
            foreach($item as $k => $v)
            {
                if($v!=null)
                {
                    $items[]=$v;
                }
            }
            $nitem = implode(",", $items);
            $arrvendor[$i]["items"]=$nitem;
            
            unset($items);
            unset($nitem);
            unset($item);
            
            //get last shipment
            $shipment_date = $this->getLastShipment($ssi_fetch["vendor_id"]);
            $arrvendor[$i]["shipment"]=($shipment_date!=NULL) ? $shipment_date: "None";
            
            // then loop through contact
            $ssi_querys = "select contact_phone_1_text, contact_first_last_name from ssi_contact where vendor_id='$vid' order by sequence_number limit 1";
            $ssi_results = $connection->CreateCommand($ssi_querys)->query();
            $ssi_num_rows = $connection->CreateCommand($ssi_querys)->execute();
            
            if($ssi_num_rows > 0)
            {
                foreach($ssi_results as $ssi_fetchs)
                {
                    $cname = $ssi_fetchs["contact_first_last_name"];
                    $cnumber = $ssi_fetchs["contact_phone_1_text"];
                    $arrvendor[$i]["contacts"]=$cname;
                    $arrvendor[$i]["cnumber"]=$cnumber;
                }
            } else {
                $arrvendor[$i]["contacts"]="-";
                $arrvendor[$i]["cnumber"]="-";
            }
            $i++;
        }
        return $arrvendor;
    }// end function



panggil di controller :

        $listing=Vendor::model()->listVendor();
        
        // Create filter model and set properties
        $filtersForm=new FiltersForm;
        if (isset($_GET['FiltersForm']))
            $filtersForm->filters=$_GET['FiltersForm'];
 		
        // Get rawData and create dataProvider
        $filteredData=$filtersForm->filter($listing);
        $dataProvider=new CArrayDataProvider($filteredData, array(
        'sort'=>array(
            'attributes'=>array('id','name','contacts','shipment','items'),
            ),
        'pagination'=>array(
            'pageSize'=>10,
            ),
        ));
     			
        // Render
        $this->render('index', array(
            'filtersForm' => $filtersForm,
            'dataProvider' => $dataProvider,
        ));




di view :
/* @var $this VendorController */
/* @var $dataProvider CActiveDataProvider */

$this->menu=array(
	array('label'=>'Create Vendor', 'url'=>array('create')),
	array('label'=>'List Contact', 'url'=>array('/contact')),
	array('label'=>'Reset Filter', 'url'=>array('/vendor')),
);
?>
Vendor
<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'type'=>'striped bordered condensed',
    'dataProvider'=>$dataProvider,
    'template'=>"{items}\n{pager}",
    'filter'=>$filtersForm,
    'afterAjaxUpdate'=>"function(){jQuery('#FiltersForm_shipment').datepicker({'dateFormat': 'yy-mm-dd'})}",
    'columns'=>array(
        array('name'=>'seq', 'header'=>'No','filter'=>false),
        array('name'=>'name', 'type'=>'raw','value'=>'CHtml::link($data[name],"vendor/view/".$data[id])','header'=>'Name',
        'htmlOptions'=>array('class'=>'span2')
        ),
        array('name'=>'contacts', 'header'=>'Contact Name',
        'htmlOptions'=>array('class'=>'span2')
        ),
        array('name'=>'cnumber', 'header'=>'Contact Number','filter'=>false),
        array('name'=>'items', 'header'=>'Item Supplied',
        'filter'=>CHtml::listData(RawMaterial::model()->findAll(), 'raw_material_name', 'raw_material_name'),
        'htmlOptions'=>array('class'=>'span2')
        ),
        array('name'=>'shipment', 'header'=>'Last Shipment','type'=>'raw',
        'value'=>'($data[shipment]!=="None") ? date_format(new DateTime($data["shipment"]), "d F Y") : "None"',
        'filter'=>$this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'name'=>'FiltersForm[shipment]',
            'attribute'=>'date',
            'options' => array(
                'dateFormat' => 'yy-mm-dd'
            )
        ), true),
        'htmlOptions'=>array('class'=>'span2')
        ),
        array(
            'class'=>'CDataColumn',
            'type'=>'raw',
            'value'=>'CHtml::link("Edit","vendor/update/".$data[id])',
            'header'=>'Edit Vendor',
            'filter'=>false,
 			),
        array(
            'class'=>'CDataColumn',
            'type'=>'raw',
            'value'=>'CHtml::link("Add","contact/create",array("target"=>"_blank"))',
            'header'=>'Add Contact',
            'filter'=>false,
 			),
        array(
            'class'=>'CDataColumn',
            'type'=>'raw',
            'value'=>'CHtml::link("Remove","vendor/delete/".$data[id],array("confirm"=>"Are you sure you want to remove this Vendor?","title"=>"Remove Vendor"))',
            'header'=>'Remove Vendor',
            'filter'=>false,
 			),
    ),
));


maaf agan2 apabila berantakan, ane baru belajar Yii :3
0

#86 User is offline   reza zuneva 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 30-September 13

Posted 06 October 2013 - 04:39 AM

salam semua rekan... saya sedang memulia belajar YII Framework, sudah download ebook (terima kasih dengan sangat ya master).. kendalanya pass install yiic muncul error "php.exe - system error... the program can't start because php_mbstring.dll missing from your computer"

NEED HELP????
0

#87 User is offline   Theo Fileo Pradipta 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 30-September 13

Posted 06 October 2013 - 08:39 PM

iya nih, kapan keluar tutorial nya, jadi gak sabar :D
0

#88 User is offline   dewe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-October 13

Posted 25 October 2013 - 07:50 PM

salam kenal...!
0

#89 User is offline   Ferry Lukito 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 27-May 12

Posted 20 November 2013 - 08:14 PM

View Postreza zuneva, on 06 October 2013 - 04:39 AM, said:

salam semua rekan... saya sedang memulia belajar YII Framework, sudah download ebook (terima kasih dengan sangat ya master).. kendalanya pass install yiic muncul error "php.exe - system error... the program can't start because php_mbstring.dll missing from your computer"

NEED HELP????


PHP nya bermasalah kyanya,
coba download ulang aja PHP nya...
0

#90 User is offline   triosn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-January 14

Posted 07 January 2014 - 05:05 AM

salam kenal yaa om/sis ikutan gabung yii indonesia
0

#91 User is offline   Dedy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-March 14

Posted 13 March 2014 - 09:01 PM

Salam Kenal, saya baru mulai belajar Yii nh sob.
thx semua bwt yg dh sharing ilmu n tutorial2 yg bermanfaat.
saya mohon izin utk ambil informasi n tutorial yg diberikan. semoga kedepannya saya dpt kembangkan dan disharing di forum ini.

thx all.
0

#92 User is offline   mallarangeng 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 22-March 14

Posted 22 March 2014 - 08:39 AM

Ijin gabung ya gan, baru buat id nya
0

#93 User is offline   viduka 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 17-June 14

Posted 17 June 2014 - 11:02 PM

mau nanya nih bro, saya ikutin tutorial yang ada d sini www . yiiframework . com / doc / guide / 1.1 /id/ quickstart.first-app

pada saat di bagian Mengakses halaman CRUD
http: // hostname / testdrive / index. php?r=user

ada error seperti ini

Quote

CDbCommand::fetchColumn() failed: SQLSTATE[HY000]: General error: 942
OCIStmtExecute: ORA-00942: table or view does not exist
(ext\pdo_oci\oci_statement.c:146). The SQL statement executed was: SELECT
COUNT(*) FROM "t_user" "t".
in C:\xampp\htdocs\yii\test\dua\protected\views\user\index.php (17)
in C:\xampp\htdocs\yii\test\dua\protected\controllers\UserController.php
(133)
in C:\xampp\htdocs\yii\test\dua\index.php (13)


kalau di liat dari user\index.php (17)

<?php
$this->breadcrumbs=array(
	'Tusers',
);

$this->menu=array(
	array('label'=>'Create TUser', 'url'=>array('create')),
	array('label'=>'Manage TUser', 'url'=>array('admin')),
);
?>

<h1>Tusers</h1>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
)); ?>


code di atas adalah code yang di generate dari gii.. mohon pencerahannya.. saya udah cari dan coba memahami tapi belum nemu solusinya..

terima kasih
0

#94 User is offline   okeyii 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-April 14

Posted 19 June 2014 - 02:48 AM

mungkin bisa ke sini : yiiframework.com/doc/guide/1.1/id/quickstart.what-is-yii
0

Share this topic:


  • (5 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users