[fw-general] Release of the ZF + Doctrine 1 Integration

2010-05-23 Thread Benjamin Eberlei

Hello everyone,



I completed a first version of Zend + Doctrine 1 integration today and

want to share it with all you. Since currently the status on a 1.11

release is unclear I

contacted all the contributors to various Doctrine-related components

and combined them into a single release and wrote some documentation on

all the different parts and how they relate to each other.



http://github.com/beberlei/zf-doctrine



The code is under the New BSD License. There is a comprehensive getting

started guide

shipped with the Github Project.



The following parts are included in this release:



* Application Resource contributed by Matt Lurz

* Dynamic Form Generation contributed by Jani Hartikainen

* Paginator Adapter contributed by Matt Lurz and Juozas Kaziukenas

* Zend Tool Provider and modular Zend Project Style Support



Thanks to all the contributors and various other people that contributed

ideas and code.



For any feedback regarding this integration, you can use

the issue tracker on Github.



This release depends on Doctrine 1.2.2 to allow model code-generation

from YAML files that supports Zend Framework Modular projects and their

directory structure.



Most of the current glue code out there is made obsolete by generating

Models that follow the Zend Framework naming conventions, into Zend

Framework models/ directories. Additionally there is also support for

modular applications whose model classes should follow the PEAR naming

schema.



Additionally the dynamic form support allows to create simple forms that

allow to create and edit Doctrine_Record instances and their relations. 

This is a great help to rapidly prototype admin forms (however support

for more complex forms is not yet included).



Since both projects are currently very focused on their 2.0 releases,

this release aims to glue all the existing code for Doctrine 1.x and

Zend Framework integration 1.x together, giving them a platform to

flourish.



greetings,

Benjamin


Re: [fw-general] pass parameters with contextSwitching

2010-05-23 Thread Hector Virgen
ContextSwitch doesn't support per-context variables, but you can accomplish
this using the built-in params. For example, you can use a switch on the
format parameter in your list action:

$format = $this-_request-getParam('format');
switch ($format) {
case 'list':
/* ... */
break;
case 'json':
/* ... */
break;
}

--
Hector


On Sat, May 22, 2010 at 2:37 AM, shahrzad khorrami 
shahrzad.khorr...@gmail.com wrote:


 hi all,

 I want to pass 'vulnerabilities.xml' to list action(it means that I want to
 variable that value in list action)... but I use of contextSwitching. How
 can I do that? How can I pass parameters with contextSwitching to a action??

 (this value come from extjs, baseParams...)


 public function init()
 {
 $this-_helper-contextSwitch()
 -addActionContext('list', 'json')
 -setAutoJsonSerialization(true)
 -initContext();
 }


 ...

 public function listAction()
 {
 $nodes = simplexml_load_file('*vulnerabilities.xml*'); // must be
 $nodes = simplexml_load_file($xml);
 $total['total'] = 5;
 if (is_object($nodes)) {
 $result = get_object_vars($nodes);
 }
 $result = array_merge((array)$total, (array)$result);
 $this-view-assign($result);
 }



 Thanks,
 Shahrzad



[fw-general] Zend View Helper

2010-05-23 Thread Andreas Kraftl
Hello,

what is the simplest way to get a working Zend_View_Helper?

I init a clean project with Zend Tool and add a layout with Zend Tool.

Then I add a class in application/views/helpers/Sujet.php

class Zend_View_Helper_Sujet extends Zend_View_Helper_Abstract
{

public function sujet()
{
return I am the sujet view helper;
}
}

In my layout script I call $this-sujet() without success.

Error: Zend_Loader_PluginLoader_Exception: Plugin by name 'Sujet' was
not found in the registry; used paths: ...

My Bootstrap.php is empty?

What must I change that it is working? Is it possible only to change the
application.ini?

Thanks
Andreas
PS: I just searching for the really simplest way :-).
-- 
Kraftl EDV - Dienstleistungen
Linux, Linuxschulungen, Webprogrammierung
Autofabrikstraße 16/6
1230 Wien



Re: [fw-general] pass parameters with contextSwitching

2010-05-23 Thread shahrzad khorrami
thanks :)

-- 
Shahrzad Khorrami


[fw-general] call a function from another module..

2010-05-23 Thread shahrzad khorrami
hi all,

I have a soap module, Soap_IndexController class and its methods. I want to
use of these functions results in another module, controller action..
how I can do that? call that function, assign the output of that function to
a variable...note that I can't use of _forward because it can't return the
result..

Regards,
Shahrzad Khorrami


Re: [fw-general] call a function from another module..

2010-05-23 Thread Hector Virgen
You can instantiate a controller like any other class, but you'll need to
pass the request and response to the constructor. From there, if your method
is public, you should be able to call it no problem.

However, I'm not sure if the built-in autoloader is set up to handle
controllers. You may need to require_once the file or provide your own
autoloader implementation.

Also, you may want to consider moving that function into your model layer.
Overall it's much easier to reuse functions if they are part of your models
instead of within controllers.

--
Hector


On Sun, May 23, 2010 at 10:29 PM, shahrzad khorrami 
shahrzad.khorr...@gmail.com wrote:

 hi all,

 I have a soap module, Soap_IndexController class and its methods. I want to
 use of these functions results in another module, controller action..
 how I can do that? call that function, assign the output of that function
 to a variable...note that I can't use of _forward because it can't return
 the result..

 Regards,
 Shahrzad Khorrami



Re: [fw-general] call a function from another module..

2010-05-23 Thread shahrzad khorrami
Thanks for reply,

Hector, is this your mean:

in xio module:

class Xio_IndexController extends Zend_Controller_Action
{
public function listAction()
{
include '../../soap/controllers/IndexController.php';

$soap = new Soap_IndexController();
$kj = $soap-salam();


and  in soap module:

class Soap_IndexController extends Zend_Controller_Action
{
public function listAction()
{
include '../../soap/controllers/IndexController.php';

..


it didn't work..:(

can't I use of action helpers? I can't find a good sample in www about my
problem..

Regards,
Shahrzad


Re: [fw-general] call a function from another module..

2010-05-23 Thread shahrzad khorrami
  and  in soap module:

class Soap_IndexController extends Zend_Controller_Action
{

  public function salam(){
return salam;
}