Is there a easy way to integrate phpthumb in zend framework ? Please help me with sample code if possible, thanks
相关问题
- Zend Auth locked session
- Zend/PHP: Problem uploading/downloading file to/fr
- PHP Zend Framework - Zend_Config and global state
- 'Zend_Db_Statement_Exception' with message
- How to handle with foreign languages?
相关文章
- Possible disadvantages of Zend [closed]
- Zend Framework Modules with common resources
- Zend Form Validator Callback: How to exclude a use
- Exception while setting up the wurfl in zend
- How to create admin in Zend framework?
- zend framework and jquery - attach event from serv
- Magento: Programatically update cart via event
- move_uploaded_file() with Zend doens't
application/Bootstrap.php
application/configs/application.ini
put files in
My answer is based on this answer by David Weinraub as it may not be clear to you how to translate that answer to your situation. I suppose you wouldn't have posted this question otherwise.
I am assuming you are using the Zend Framework recommended directory structure.
Under your
library
directory create aphpthumb
directory and copy all the files from the zip archive into it.Add the following line to application.ini
Create your autoloader, mine is in
App/Loader/Autoloader/PHPThumb.php
and looks like this:-Initialise your autoloader in your bootstrap:-
Once that is done you can use php thumb thus:-
I have tested this only so far as to instantiate an instance of phpthumb, I haven't tested it's functionality. Also, you may be able to delete many of the files in the phpthumb directory as it looks to me as if many of them are demo files.
Create a directory name custom inside your 'library' folder . Inside this 'Custom' directory put PHPThumb library as it is . Basically we are exploiting the fact library directory is part of include_path . So now wheresoever you want to use it just simply do