background preloader

CodeIgniter + Doctrine

Facebook Twitter

Learn, Build, & Test RegEx. Instagram. John.Thoughts.Log. Instagram. Execute codeigniter controller from batch file. Codeigniter and autocomplete with jQuery. Web, Mobile and Social Technology Tips, Tutorials, Best Apps. 1. Integrating WYSIWYG TinyMCE into CodeIgniter TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source. It has the ability to convert HTML textarea fields or other HTML elements to editor instances. TinyMCE is very easy to integrate, all WYSIWYGs are. When I was picking WYSIWYG for my website then I was between this and CKEditor. 2. The following explains how to incorporate FCKeditor using Code Igniter’s 1.4x Libraries. Place your FCKeditor files in your CI base directory (in this example I’ve put the files under a folder called plugins). 3.

Xinha WYSIWYG editor is a very useful tool to edit and create html. 4. SPAW is a very powerful and easy to use visual editor that I like to use in my applications. I wanted to keep it flowing with the rest of my CI app by using the loader class to load it (instead of including it at strange places in my views), so I turned it into a custom library which can be loaded. Integrating WYSIWYG TinyMCE into CodeIgniter. Using Views with Doctrine. I’ve seen a few requests recently on how you can use a view with Doctrine.

Using Views with Doctrine

This is very easy and I’ve also learned a few neat tricks that you can do to accomplish abnormal things while writing this article. Creating the View First I will demonstrate how you can turn a normal Doctrine_Query instance in to a view. This is just as easy as creating an instance of Doctrine_View and setting a reference between the query and the view. <? To create the view in the database you can call the Doctrine_View::create() method. <? Executing the View Now when the Doctrine_Query instance above is executed, it will execute the SQL for the view instead of parsing the DQL, generating the SQL and executing it.

<? Executing the above would execute the following SQL query. [sql] SELECT * FROM test_view Tweaking the View Now here is where things get interesting. We can get the SQL from the query, modify it, then manually create the view in our database. Using Doctrine ORM With Codeigniter Framework. I have already discussed few articles on codeigniter along with codeigniter basics.

Using Doctrine ORM With Codeigniter Framework

Codeigniter has good library/mechanism for manipulating database activity. Besides, it introduced active record class, which minimizes the complexity of writing SQL query. However, database support in codeigniter isn’t still good enough for many. Specially, many developers prefer to work with ORM for database layer and codeigniter doesn’t provide such built in support.

However, doctrine is a very powerful ORM in php and it is possible to easily integrate and use doctrine with codeigniter as ORM. Download And Install: First, please download the latest doctrine orm. NOTE: This above code requires php 5.3.x version installed on your server. The above class is almost same as the one described on official reference, just optimized to be usable on codeigniter 2.x versions. Read The Complete CodeIgniter Tutorials Series By CodeSamplez.com Create Entity From Database Automatically: Integrating Doctrine 2 with CodeIgniter 2. If you’re looking for a quick way to get Doctrine 2 running with CodeIgniter 2, you might want to download my CodeIgniter 2/Doctrine 2 package Overview CodeIgniter is a great PHP framework.

Integrating Doctrine 2 with CodeIgniter 2

The codebase is clean, the documentation is fantastic, and it’s regularly updated. Doctrine is a good ORM for the same reasons: it’s very well-written, has extensive documentation, and is actively developed. A combination of these two systems makes it easy to build database-oriented web applications quicker than ever before. CodeIgniter 2 and Doctrine 2 Integration – A working setup (DoctrineIgnited) Doctrine 1.2 ORM Manual.