Giter VIP home page Giter VIP logo

beehivebehavior's Introduction

○設定項目一覧
  ・path => ファイル保存場所へのパス
            ※書き込み権限があれば、存在しないパスは自動的に作成されます。
              例)
                'image1' => array('path'=>'/image/aaa/bbb')
                bbbのディレクトリがない状態で
                /webroot/aaaに書き込み権限があればbbbディレクトリが作成されbbbに画像が配置されます。
                ※極論webrootに書き込み権限があれば、ディレクトリは自分で作成する必要はないですがw

  ・resize => 画像のリサイズ設定
              ※横サイズを基準に縦サイズをリサイズします。
                例)
                  'image1' => array('path'=>'/image/aaa/bbb', 'resize' => 640)

  ・delete => アップロードしたファイルの削除処理を行うかのフラグ
              true : 削除する(デフォルト)
              false : 削除しない
                例)編集画面で「delete_カラム名」のチェックボックスを設けるとファイル削除を行います。(※DBにカラムは必要ありません。)
                  // image1の値をnullにして、ファイルを削除
                  'image1' => array('path'=>'/image/aaa/bbb', 'delete' => true)
                  // image1の値をnullにするが、ファイルの削除を行わない
                  'image1' => array('path'=>'/image/aaa/bbb', 'delete' => false)

                  // viewファイル
                  $this->Form->input('image', array('type'=>'file'));
                  $this->Form->input('delete_image', array('type'=>'checkbox'));


○DBに保存される項目
  ・webroot以下のパスが保存されるのでimageヘルパーや、linkヘルパーに直接渡すことができます。
    例)画像を表示
      $this->Html->image($this->data['Hoge']['image']);
    例)リンクを表示
      $this->Html->image('添付ファイル', $this->data['Hoge']['file']);

beehivebehavior's People

Contributors

kozo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.