开发者

How can i use Zend framework in my php project?

I want to kn开发者_如何转开发ow how can i use Zend Framework in my php project where my web host doesnt support it. Im using only bunch of the Zend classes, so can I put them inside my include folder and upload it to my site? Will this work?


First include autoloader class.

require_once 'lib/Zend/Loader/StandardAutoloader.php';
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));

$loader->registerNamespace('Http\PhpEnvironment', 'lib/Zend/Http');

//Register with spl_autoload:
$loader->register();

and then use below line

$a = new Zend\Http\PhpEnvironment\Request();
echo $a->getQuery()->get();

this is just the demo that you can use loosly coupled zend library to your project.


Here is great place to get started http://framework.zend.com/manual/en/

If you host supports PHP 5, then Zend Framework will work without any problems.

Usually Zend directory is placed inside of lib directory, look at Quick Start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜