Welcome Guest, Not a member yet? Register   Sign In
Using Zend Framework with CodeIgniter
#1

[eluser]fredwu[/eluser]
Hey guys,

Recently I've started working with both CI and Zend Framework. I've actually come across this tutorial a couple of months ago.

However, I really don't think implementing it using hooks is really necessary. Therefore I wrote a simpler tutorial on how to use the two frameworks together.

Tutorial link: http://thislab.com/2008/02/21/using-zend...deigniter/

Please let me know what you think? Is it really necessary to use hooks?
#2

[eluser]John Fuller[/eluser]
Depends on what you want to use. Some libraries (Zend Date for instance) can just be dropped right into the libraries folder and used just like any other library. Doing this (using just one library and leaving the rest behind) requires changing all the paths and copying over all the dependent files though because the default structure assumes you are using the entire Zend library. This is easy with an editor which can do a search and replace across multiple files/directories.
#3

[eluser]fredwu[/eluser]
[quote author="John Fuller" date="1203560408"]Doing this (using just one library and leaving the rest behind) requires changing all the paths and copying over all the dependent files though because the default structure assumes you are using the entire Zend library.[/quote]

I don't quite get this part: why is using one library file requires copying over all the dependent files? By default all the library does is to make sure the include path is set correctly so that when loading ZF classes, it knows where to look for them. There is no file copying involved during the library initialization stage.

Or am I missing something here? I haven't looked into ZF too deeply yet so I might have misunderstood how ZF works internally.
#4

[eluser]John Fuller[/eluser]
I am not sure I totally understand your question. Download the library and take a look at Zend Date to see what I am referring to. I used that component as an example because it is really simple.

You don't have to do what I did. Sometimes I just one to use one component from Zend and toss the rest so I don't have a bunch of extra files I am not using lying around. Each component has multiple files and common dependencies which are interconnected using includes.

Otherwise, if you follow the docs of the framework you are actually supposed to put the path of the Zend library in your environment path so the server checks that path automatically when running scripts.
#5

[eluser]jbads[/eluser]
Hi Canglan, thanks for posting this tutorial. I am having trouble loading the zend framework. I have followed your technique as best I could , however

When I add this code to my controller is this:
if($this->load->library('zend'))
{
echo 'error';
}

$this->load->view('viewfile');
I get a page with an asterix and an output buffering error. My log file shows this error

ERROR etc. Severity: Warning --> fopen(Zend/Validate/Hostname/Com.php)

If I remove the load library code the page displays fine.

Have you encountered anything like this before while trying to use CI and Zend together?

Thanks, Jake
#6

[eluser]Unknown[/eluser]
http://thislab.com/2008/02/21/using-zend...deigniter/ is not working. I have problem using GDATA with Ci. Please help
#7

[eluser]maria clara[/eluser]
[quote author="fredwu" date="1203559402"]Hey guys,

Therefore I wrote a simpler tutorial on how to use the two frameworks together.

Tutorial link: http://thislab.com/2008/02/21/using-zend...deigniter/

[/quote]

hi, your link seems to be broken...page not found in my browser..
#8

[eluser]cereal[/eluser]
They moved the blog, here's the new link: http://www.beyondcoding.com/2008/02/21/u...deigniter/

Anyway there is another way to implement it:

- http://www.okadadesign.no/blog/?p=410

I'm trying it now, seems good to me Smile
#9

[eluser]Unknown[/eluser]
great tutorial. i will try it. thanks bro.




Theme © iAndrew 2016 - Forum software by © MyBB