PHPackages                             icebox-php/icebox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. icebox-php/icebox

ActiveProject[Framework](/categories/framework)

icebox-php/icebox
=================

The skeleton application for the Icebox Framework.

v0.1.2(6mo ago)00MITPHP

Since Dec 11Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/icebox-php/icebox)[ Packagist](https://packagist.org/packages/icebox-php/icebox)[ Docs](http://torovin.com/icebox)[ RSS](/packages/icebox-php-icebox/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

How to create icebox project
============================

[](#how-to-create-icebox-project)

`composer create-project icebox-php/icebox my-app`
`cd my-app`

How to run this web-app
=======================

[](#how-to-run-this-web-app)

`cd my-app`
`composer install`
`php icebox server`
It will run the application to this url

If you want to run in different host and port
`php icebox server --host=0.0.0.0 --port=8802`
It will run the application to this url

Home:

Page 2: [http://localhost/my-app/index.php/leap\_year/2012](http://localhost/my-app/index.php/leap_year/2012)
or : [http://localhost/my-app/leap\_year/2012](http://localhost/my-app/leap_year/2012)

Example urls to test params
---------------------------

[](#example-urls-to-test-params)

404 error page
--------------

[](#404-error-page)

How to run testsuite
====================

[](#how-to-run-testsuite)

`vendor/bin/phpunit ./Test/`

How to upload image
===================

[](#how-to-upload-image)

1. create a string column, Such as, I added "picture" column, datatype: varchar, length: 255
2. Add this code to \_form:

```

    Picture

```

3. In controller, after you save model, a. upload file and b. set file name in model and c. save the model again with validate false.
    Add this code to controller (I added this code in "create" action):

```
if($saved) {

    if(isset($_FILES['picture'])) {
      $pictue_file_name = md5(microtime()) . '.jpg';
      $path = 'public/images/' . $pictue_file_name;
      move_uploaded_file($_FILES['picture']['tmp_name'], $path);
      $post->picture = $pictue_file_name;
      $post->save(false);
    }

    ....
    ....
} else {
    ....
    ....
}

```

4. now you can show this image in "View/Posts/show.html.php" view:

```
