Using zend framework in joomla - zend-framework

Is that possible? How do i do it? I have tried installing in the plugin manager but still it's not reflected in the plugin screen. Any hints or guide would be much appreciated!
Thanks!

Zend Framework works as a library as well as an MVC Framework.
What you can do is copy the Zend Framework library into your project. Then you can basically include the relevant classes you would like to use.
This is an example for using the Zend_Json::encode() function:
$zend_library_path = 'ZendFramework/library/Zend';
set_include_path ( get_include_path() . PATH_SEPARATOR . $zend_library_path);
include_once('Json.php');
echo Zend_Json::encode( array('hello'=>'world') );

Related

Generate PDF in Play Framework Scala

I'm using Play framework 2.2.x and I'm looking for some plugin/lib for generating PDF.
I found this plugin:
https://github.com/joergviola/play20-pdf,
but it's for Java and is not supported already
Do u know some repository with this library? Or some alternatives for Scala and Play Framework?
=== Update
I found some fork, but still no working repository
https://github.com/alias1/play2pdf
Try this one https://github.com/Kaliber/scala-pdf. It is really easy to use, and you can define your own css or even use bootstrap.
This seems to be a very good solution : https://github.com/cloudify/sPDF
Otherwise, I highly recommend http://www.html2pdf.it/
Well javascript can be easy solution . You can use jspdf .

Trying to use Zend Escaper from ZF 2.1 in Zend Framework 1.11.11

I am trying to use the Zend Escaper class from Zend Framework 2.2 in Zend Framework 1.11.11 by copying the Escaper folder from the ZF 2.2 into ZF 1.11.11. I am trying to do this becuase in the Zend Escaper class documentation it says that the class is a stand-alone class and is not dependent on any of the other Zend classes/interfaces.
But once I added the folder into our ZF 1.11.11 library and tried instantiating the Zend Escaper class and load the web page all I am seeing is an empty page. I am unable to debug this. I tried to print the object that is returned on instanitation using print_r but that did not work.
Our application is built on ZF 1.11.11, switching to ZF 2.2 is a huge risk for us and would be a major change to our application. That is why I am trying to do this.
Please help me know whether it is possible to make Zend Escaper class work in ZF 1.11.11 in the way I am trying to do. If so, why am I getting this problem.
Also, is there any class in ZF 1.11.11 that I could use for encoding/escaping.

url for an action of a controller in zend framework

I am trying to learning Zend framework. For that I have installed NetBeans IDE and download zend framework's library. I have created one small application by NetBeans IDE and place the zend framework's library under library folder.
Under Controller folder, in IndexController.php file, I have written one action called indexAction() and there I write simply $this->view->assign('title', 'Hello, World!');.
Under views/scripts/index folder create one file called index.phtml and there I have written out <h1><?php echo $this->escape($this->title); ?></h1>.
My main folder name is phpproject1 and under that I have created all other folders like application, library,public.
Now please suggest me how to open that action in browser?
e.g. - In codeigniter it is like : localhost://project_name/index.php/controller_name/action_name
Thanks in advance.
I assume your installation is correct and you didn't configure any route. try to adapte this to your case.
http://lcalhost/[project_Name]/public/[Module_name]/[Controller_name]/[action_name]
in case you dont have Module;
http://lcalhost/[project_Name]/public/[Controller_name]/[action_name]

Zend-Framework 1.x with Doctrine 2.x

I know that there are many examples but this is my problem, because now I don't know which is the best and I don't understand every samples. This before I used doctrine 1.x and that was more simple for me, because there was only few steps to connect to database with doctrine and use it:
1.) Created User.yml file into application/doctrine/schema folder
2.) Run generate-models-yaml in cli which generated php classes into application/models/generated folder
3.) Again in cli run: create-db, create-tables
4.) In IndexController / IndexAction I can use it:
$newUser = new User();
$newUser->name = 'Demo';
$newUser->save;
And that's all. But with 2.0 I have some question:
- Where is the best place for mapping yaml files?
- How can I generate Entities from yaml? (Depending from the first answer)
- How can I create/drop db and tables?
- Which solution is the best EntitiyManager?
So I just want the most simple sample like my doctrine 1.x sample. Thanks!
For me best integration Bisna from Guilherme Blanco https://github.com/guilhermeblanco/ZendFramework1-Doctrine2
Step by step video tutorial using Bisna integration
http://www.zendcasts.com/unit-testing-doctrine-2-entities/2011/02/
Another very good example of ZF1 and Doctrine 2 with fully tested code (PHPUnit & Ant):
https://github.com/eddiejaoude/Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-
They try to work best practice. Always.
Here is my two cents, I've wrote a Zend Framework 1.x resource for Doctrine 2.0
The source code is available on github.
This is another sample about zf1 and D2
https://github.com/marsbomber/zf1-doctrine2/tree/modular_setup
I used it and I think it was useful.

Wordpress And Zend

I am wanting to do stuff with the Google Data API, the contacts specifically. The easist method i have found so far is using Zend. The problem I am having is adding the Zend framework. Does anyone know how to do this with WordPress?
Thanks
you can use "hardcoded" includes if you fail to setup autoloading ->
in /wp-content/themes/levitation/send.php insert to the first line:
require_once 'your/path/to/zend/Zend/GData/ClientLogin.php';
Problem is you need to get through all the errors and alwas include the missing class (inside classes are the includes taken care of...
Or in the main file (guess index.php) insert:
set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/zend/');
//for ZF below 1.8
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
//for ZF > 1.8
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::setFallbackAutoloader(true);
It should be pretty trivial.
Write and test some bootstrap code that sets up ZF's autoloading and make sure it generally works.
Stick that code in a wordpress plugin, and tie things up to the right hooks in wordpress.
Try this http://blueberryware.net/2008/09/04/wp-library-autoloader-plugin
I think all you need is there.
Make sure that you are calling:
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
before you are using that class. And that you have a developer key.