Posts tagged with yii

  • Yii2 and Postgresql

    This is a quick note about my favorite PHP framework (Yii2) which I used recently.

    Postgresql File Upload

    1.  // upload handling
    2.  // retrieve upload file if is a post
    3.  if($model->load(...))
    4.  {
    5.    $uploadFile = UploadedFile::getInstance($model, 'some_file');
    6.  }
    8.  if(validateSuccess)
    9.  {
    10.    // retrieve tmp file content and convert to hex to store into bytea
    11.    $model->byteaColumn = bin2hex( file_get_contents($uploadFile->tempName) ); 
    12.    ...
    13.    $model->save();
    14.  }

    Postgresql File Download Script

    1.  $response = \Yii::$app->response;
    2.  $response
    Read More
  • Yii 2 Beta Release - Hurray

    It is now 3am in the morning. My love is sleeping happily. And I am happily learning about the new version of the Yii framework. It is just awesome as usual :) I can see lots of work have been put into this version. Now Yii has 2 application templates (basic , advanced) and tons of new features which should make it a leading framework again :) It offers so much more than Laravel (more opinionated) and offers a lot more features out of the box :) Beta version also gives me more confidence in its stablity.

    I prefer the way Yii handle...

    Read More