Re: [fw-general] A question about bootstrapping modules

2009-05-07 Thread keith Pope
2009/5/8 Rick Buitenman :
> Hi,
>
> There are a number of threads on bootstrapping modules, but I think it might
> help to isolate what seems to be a reoccuring source of confusion (at least
> it is for me):
>
> Am I right in assuming that *all* bootstraps of all modules are executed
> regardless for which module the request is?

Yes, the module bootstrap resource will loop and call each module
bootstrap, though it skips the default module.

>
>
> R.
>
>
>
>
>



-- 
--
[MuTe]
--


Re: [fw-general] Finding active module/controller

2009-05-07 Thread keith Pope
2009/5/8 iceangel89 :
>
> how can i know the active module/controller thats running so i can set view
> parameters? to make my nav show which link shld be active?
>
> Zend_Navigation menu is not working correctly for me yet. so this will be a
> workaround 1st. anyway its good to know.

Info is stored in the request object

> --
> View this message in context: 
> http://www.nabble.com/Finding-active-module-controller-tp23438661p23438661.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
--
[MuTe]
--


[fw-general] A question about bootstrapping modules

2009-05-07 Thread Rick Buitenman

Hi,

There are a number of threads on bootstrapping modules, but I think it  
might help to isolate what seems to be a reoccuring source of  
confusion (at least it is for me):


Am I right in assuming that *all* bootstraps of all modules are  
executed regardless for which module the request is?



R.






[fw-general] ZF1.8 problem in getting modular structure work

2009-05-07 Thread vinodp

hi all,
is there any tutorial available for working on modular form in zend 1.8,
in previous version it seemed quite easy, but in 1.8 i am confused.


-- 
View this message in context: 
http://www.nabble.com/ZF1.8-problem-in-getting-modular-structure-work-tp23439086p23439086.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] ZF1.8 Switching layouts between modules.

2009-05-07 Thread Mon Zafra
What you basically need is to defer the setting of layout until
routeShutdown. This can be done with a controller plugin. Matthew's
suggestion [
http://framework.zend.com/issues/browse/ZF-6568?focusedCommentId=30741#action_30741]
is to have your module bootstrap register a plugin which implements
routeShutdown() or dispatchLoopStartup(). The plugin method checks the
current module, then do stuff if it matches with the calling bootstrap
module.

Personally, I don't like this method because it could lead to lots of unused
plugins. I prefer to have only one plugin that pulls the current module from
the request, pulls its bootstrap from the modules resource and executes a
specific method.

class Mz_Plugin_ModuleLazyInit extends Zend_Controller_Plugin_Abstract
{
protected $_bootstraps;

public function __construct($bootstraps)
{
$this->_bootstraps = $bootstraps;
}

public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
if (isset($this->_bootstraps[$module])) {
$bootstrap = $this->_bootstraps[$module];
if (method_exists($bootstrap, 'lazyInit')) {
$bootstrap->lazyInit();
}
}
}
}

// application bootstrap
protected function _initPlugins()
{
if ($this->hasPluginResource('modules')) {
$this->bootstrap('modules');
$this->bootstrap('frontController');
$bootstraps = $this->getResource('modules');
$front = $this->getResource('frontController');

$plugin = new Mz_Plugin_ModuleLazyInit($bootstraps);
$front->registerPlugin($plugin);
}
}

// module bootstrap
public function lazyInit()
{
$appBootstrap = $this->getApplication();
$appBootstrap->bootstrap('layout');
$layout = $appBootstrap->getResource('layout');
$layout->setLayoutPath(dirname(__FILE__) . '/layouts');
}



   -- Mon


On Fri, May 8, 2009 at 8:25 AM, Karl  wrote:

>  I still have the same problem and have not been able to get different
> layouts to work when using modules. Can this actually be achieved or are we
> all trying something that has not been implemented ?
>
> Regards,
> Karl
>
>  --
> *From:* Sergio Rinaudo [mailto:kaiohken1...@hotmail.com]
> *Sent:* 07 May 2009 10:50 PM
> *To:* matt...@zend.com; fw-general@lists.zend.com
> *Subject:* RE: [fw-general] ZF1.8 Switching layouts between modules.
>
> Hi matthew,
> I added the line you said, and the layout is switched, but unfortunatelly
> for all modules, so also the default module is rendered with the admin
> layout. Any advice?
>
> Sergio Rinaudo
>
>
>
>
> > Date: Thu, 7 May 2009 16:18:44 -0400
> > From: matt...@zend.com
> > To: fw-general@lists.zend.com
> > Subject: Re: [fw-general] ZF1.8 Switching layouts between modules.
> >
> > -- Sergio Rinaudo  wrote
> > (on Thursday, 07 May 2009, 08:54 PM +0200):
> > > I've almost completed to implement all my past work in the new
> > > Zend_Application, I still have the problem on how switch layouts
> between
> > > modules. I noticed here you can specify this in the configuration ini
> file:
> > >
> > >
> http://framework.zend.com/manual/en/zend.application.available-resources.html#
> > > zend.application.available-resources.modules.configExample
> > >
> > > but if I add this line on my ini
> > >
> > > admin.resources.layout.layout = "admin"
> > >
> > > I get the error
> > >
> > > Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception'
> with
> > > message 'Resource matching "frontcontroller" not found' in
> >
> > I know what's happening here.
> >
> > The layout resource has this:
> >
> > $this->getBootstrap()->bootstrap('FrontController');
> >
> > The problem is that your _module_ bootstrap doesn't have the resources
> > that the _application_ bootstrap had -- and so it's finding no matching
> > resource to bootstrap.
> >
> > One workaround is to add this to your configuration:
> >
> > admin.resources.frontController[] =
> >
> > This will grab and return the front controller singleton, which should
> > work for these purposes.
> >
> > --
> > Matthew Weier O'Phinney
> > Project Lead | matt...@zend.com
> > Zend Framework | http://framework.zend.com/
>
> --
> Cerchi i tuoi spazi? Hotmail va oltre i 5GB. Scopri 
> perché!
>


[fw-general] Finding active module/controller

2009-05-07 Thread iceangel89

how can i know the active module/controller thats running so i can set view
parameters? to make my nav show which link shld be active? 

Zend_Navigation menu is not working correctly for me yet. so this will be a
workaround 1st. anyway its good to know. 
-- 
View this message in context: 
http://www.nabble.com/Finding-active-module-controller-tp23438661p23438661.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Navigation menu active page not working ...

2009-05-07 Thread iceangel89

anyone? the active page is always at home ...


iceangel89 wrote:
> 
> i have something like 
> 
> $reports = new Zend_Navigation_Page_Mvc(array(
> 'label' => 'Reports',
> 'module' => 'reports',
> 'controller' => 'index',
> 'action' => 'index'
> ));
> $misc = new Zend_Navigation_Page_Mvc(array(
> 'label' => 'Misc',
> 'module' => 'misc',
> 'controller' => 'index',
> 'action' => 'index'
> ));
> $media = new Zend_Navigation_Page_Mvc(array(
> 'label' => 'Media',
> 'module' => 'media',
> 'controller' => 'index',
> 'action' => 'index'
> ));
> $library = new Zend_Navigation_Page_Mvc(array(
> 'label' => 'Library',
> 'module' => 'library',
> 'controller' => 'index',
> 'action' => 'index',
> 'pages' => array($libCategories)
> ));
> $lab = new Zend_Navigation_Page_Mvc(array(
> 'label' => 'Lab',
> 'module' => 'lab',
> 'pages' => array($departments)
> ));
> $home = new Zend_Navigation_Page_Uri(array(
> 'label' => 'Home',
> 'module' => 'default',
> 'controller' => 'index',
> 'action' => 'index'
> ));
> 
> $nav = new Zend_Navigation(array(
> array(
> 'label' => 'IMS',
> 'controller' => 'index',
> 'action' => 'index',
> 'pages' => array(
> $home, $lab, $library, $media, $misc, $reports
> )
> )
> ));
> 
> but when i render my menu, home is always active... as in not a link. 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Navigation-menu-active-page-not-working-...-tp23420914p23438638.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] PhpDocumentor

2009-05-07 Thread helderfelipe

I can't generate de PhpDoc for my projects in zend studio for eclipse,
this is de error: "Error runing phpDocumentor."

what can i do ?
-- 
View this message in context: 
http://www.nabble.com/PhpDocumentor-tp23438459p23438459.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] ZF1.8 Switching layouts between modules.

2009-05-07 Thread Karl
I still have the same problem and have not been able to get different
layouts to work when using modules. Can this actually be achieved or are we
all trying something that has not been implemented ?
 
Regards,
Karl

  _  

From: Sergio Rinaudo [mailto:kaiohken1...@hotmail.com] 
Sent: 07 May 2009 10:50 PM
To: matt...@zend.com; fw-general@lists.zend.com
Subject: RE: [fw-general] ZF1.8 Switching layouts between modules.


Hi matthew,
I added the line you said, and the layout is switched, but unfortunatelly
for all modules, so also the default module is rendered with the admin
layout. Any advice?

Sergio Rinaudo




> Date: Thu, 7 May 2009 16:18:44 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] ZF1.8 Switching layouts between modules.
> 
> -- Sergio Rinaudo  wrote
> (on Thursday, 07 May 2009, 08:54 PM +0200):
> > I've almost completed to implement all my past work in the new
> > Zend_Application, I still have the problem on how switch layouts between
> > modules. I noticed here you can specify this in the configuration ini
file:
> > 
> >
http://framework.zend.com/manual/en/zend.application.available-resources.htm
l#
> > zend.application.available-resources.modules.configExample
> > 
> > but if I add this line on my ini
> > 
> > admin.resources.layout.layout = "admin"
> > 
> > I get the error
> > 
> > Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception'
with
> > message 'Resource matching "frontcontroller" not found' in
> 
> I know what's happening here.
> 
> The layout resource has this:
> 
> $this->getBootstrap()->bootstrap('FrontController');
> 
> The problem is that your _module_ bootstrap doesn't have the resources
> that the _application_ bootstrap had -- and so it's finding no matching
> resource to bootstrap.
> 
> One workaround is to add this to your configuration:
> 
> admin.resources.frontController[] = 
> 
> This will grab and return the front controller singleton, which should
> work for these purposes.
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead | matt...@zend.com
> Zend Framework | http://framework.zend.com/


  _  

Cerchi i tuoi spazi? Hotmail va oltre i 5GB. Scopri perché!
  


RE: [fw-general] ZF1.8 Right way to get zend registry instance

2009-05-07 Thread Sergio Rinaudo

Hi Mike, 

Thank you for reply.
For some reason all replys to my answer were splitted in different part, I'll 
post them here for future reference

http://www.nabble.com/FW%3A-ZF1.8-Right-way-to-get-zend-registry-instance-td23428309.html


and also the follow:

---  B E G I N ---
-- Sergio Rinaudo  wrote
(on Thursday, 07 May 2009, 06:50 PM +0200):

> Correct me if I mistake,
> if in my Action Controller I call
> 
> 
> $registry = $this->getInvokeArg('bootstrap')->getContainer();
> 
> the registry object I obtain is different than calling
> 
> $registry = Zend_Registry::getInstance();
 
Yes, these are different. The former is a local registry instance, the
latter a global singleton.
 
Zend_Registry can be used as both a singleton registry as well as a
local registry.
 
When you call Zend_Registry::get(), set(), or getInstance(), you are
using it as a singleton registry, and anytime you call it with one of
those methods, you access the same instance.
 
If you create your registry using:
 
$registry = new Zend_Registry();
 
you get a local instance. In such a case, you can access its members
either as properties or via array notation:
 
$config = $registry->config;
$config = $registry['config'];
 
but the set() and get() methods will not be available.
 
We chose this latter usage within Zend_Application as testing using a
local registry is easier to accomplish than when using a static global
one.

---  E N D ---


Sergio Rinaudo





> Date: Thu, 7 May 2009 12:42:18 -0700
> From: mike.wri...@mailinator.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] ZF1.8 Right way to get zend registry instance
> 
> Sergio Rinaudo wrote:
> > Hi, 
> > I'm wondering if there is any 'best' or 'right' way to get zend registry 
> > instance within the zf1.8 bootstrap.
> > Thanks.
> 
> How about:
> 
> $registry = Zend_Registry::getInstance();

_
Messenger 2009: scaricalo gratis!
http://messenger.it/

RE: [fw-general] ZF1.8 Switching layouts between modules.

2009-05-07 Thread Sergio Rinaudo

Hi matthew,
I added the line you said, and the layout is switched, but
unfortunatelly for all modules, so also the default module is rendered
with the admin layout. Any advice?

Sergio Rinaudo





> Date: Thu, 7 May 2009 16:18:44 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] ZF1.8 Switching layouts between modules.
> 
> -- Sergio Rinaudo  wrote
> (on Thursday, 07 May 2009, 08:54 PM +0200):
> > I've almost completed to implement all my past work in the new
> > Zend_Application, I still have the problem on how switch layouts between
> > modules.  I noticed here you can specify this in the configuration ini file:
> > 
> > http://framework.zend.com/manual/en/zend.application.available-resources.html#
> > zend.application.available-resources.modules.configExample
> > 
> > but if I add this line on my ini
> > 
> > admin.resources.layout.layout = "admin"
> > 
> > I get the error
> > 
> > Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with
> > message 'Resource matching "frontcontroller" not found' in
> 
> I know what's happening here.
> 
> The layout resource has this:
> 
> $this->getBootstrap()->bootstrap('FrontController');
> 
> The problem is that your _module_ bootstrap doesn't have the resources
> that the _application_ bootstrap had -- and so it's finding no matching
> resource to bootstrap.
> 
> One workaround is to add this to your configuration:
> 
> admin.resources.frontController[] = 
> 
> This will grab and return the front controller singleton, which should
> work for these purposes.
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/

_
Resta in contatto con gli amici, comunica con Messenger!
http://messenger.it/cominciaAcomunicare.aspx

RE: [fw-general] Zend_Search_Lucene field not found

2009-05-07 Thread Alexander Veremyev
Hi Jurriën,

Sorry for a delay with answer, but I was really overloaded last days. I'll 
answer tomorrow morning (it's already ~1AM here).

With best regards,
   Alexander Veremyev.

> -Original Message-
> From: Jurriën Stutterheim [mailto:jurr...@bellacms.com]
> Sent: Tuesday, May 05, 2009 1:04 AM
> To: Jean L; Alexander Veremyev
> Cc: Zend Framework - General
> Subject: Re: [fw-general] Zend_Search_Lucene field not found
> 
> I'm currently experiencing the same issue here. Using Luke
> (http://www.getopt.org/luke/
> ) I've confirmed that my field and its values is actually stored in
> the index. The weird things is that - using the exact same index - the
> application used to work just fine, but it started throwing these
> exceptions over-night. In my case this happened in an old project on a
> shared host where - according to the hosting provider - nothing was
> changed. Alex, any ideas as to what might be going on here?
> 
> Cheers,
> 
> - Jurriën
> 
> On Feb 25, 2009, at 07:51 , Jean L wrote:
> 
> >
> > Here it is.  Greatly appreciate your kind help.
> >
> > -
> >
> >  > require_once 'Zend/Search/Lucene.php';
> > require_once 'Zend/Search/Lucene/Document/Html.php';
> >
> > if(is_dir("/local/clien/www/html_index/an_index") == 1){
> > $index
> > =Zend_Search_Lucene::open('/local/clien/www/html_index/an_index');
> > echo "opening index...";
> > }
> > else {
> > //Create a new index
> > $index
> > =Zend_Search_Lucene::create('/local/clien/www/html_index/an_index');
> > echo "creating index...";
> > }
> >
> > $filename="AFile";
> > $doc = Zend_Search_Lucene_Document_Html::loadHTMLFile($filename);
> > $doc->addField(Zend_Search_Lucene_Field::UnIndexed('url',
> > $filename));
> > $index->addDocument($doc);
> > ?>
> >
> >
> > --
> >
> > Serkys wrote:
> >>
> >> Show me full code of creating index, please
> >>
> >>
> >> Jean L wrote:
> >>>
> >>> Thanks for the reply.
> >>>
> >>> I change it to "UnIndexed" field, however, the same error message is
> >>> still there
> >>>
> >>> Jean
> >>>
> >>>
> >>>
> >>> Serkys wrote:
> 
>  I think, URL better stored in "UnIndexed" fields.
> 
> 
>  Jean L wrote:
> >
> > Hi all,
> >
> > I'm currently having problem with indexing html files using
> > Zend_Search_Lucene.  Any help is appreciated.
> >
> > So far I can create my index properly.  I add text field "url"
> > to store
> > my file name and add that to my doc.
> >
> > Here's the problem:  when I want to show the file name, an error
> > message occurs and it reads :
> > PHP Fatal error:Uncaught exception 'Zend_Search_Lucene'with
> > message
> > 'Field name "url" not found in document.' in
> > local/zend/1.7.3/app/library/Zend/Search/Lucene/Document.php:
> > 102\nStack
> > trace:\n#0
> > /local/zend/1.7.3/app/library/Zend/Search/Lucene/Document(116):
> > Zend_Search_Lucene_Document->getField('url')#1(continued)
> >
> > The code is following:
> > -
> > $filename="aFile";
> > $doc =
> > Zend_Search_Lucene_Document_Html::loadHTMLFile($filename);
> > $doc->addField(Zend_Search_Lucene_Field::Text('url',
> > $filename));
> > $index->addDocument($doc);
> > ..
> >
> > -
> > $query=Zend_Search_Lucene_Search_QueryParser::parse($queryStr);
> > $hits = $index->find($query);
> > foreach ($hits as $hit) {
> >  echo $hit->url."";
> >  echo $hit->title."";
> > .
> >
> > Any help is appreciated.
> >
> > Jean
> >
> >
> 
> 
> >>>
> >>>
> >>
> >>
> >
> > --
> > View this message in context: http://www.nabble.com/Zend_Search_Lucene-
> field-not-found-tp22153855p22188081.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
> >
> >
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.287 / Virus Database: 270.12.18/2096 - Release Date: 05/04/09
> 17:51:00


Re: [fw-general] ZF1.8 Switching layouts between modules.

2009-05-07 Thread Matthew Weier O'Phinney
-- Sergio Rinaudo  wrote
(on Thursday, 07 May 2009, 08:54 PM +0200):
> I've almost completed to implement all my past work in the new
> Zend_Application, I still have the problem on how switch layouts between
> modules.  I noticed here you can specify this in the configuration ini file:
> 
> http://framework.zend.com/manual/en/zend.application.available-resources.html#
> zend.application.available-resources.modules.configExample
> 
> but if I add this line on my ini
> 
> admin.resources.layout.layout = "admin"
> 
> I get the error
> 
> Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with
> message 'Resource matching "frontcontroller" not found' in

I know what's happening here.

The layout resource has this:

$this->getBootstrap()->bootstrap('FrontController');

The problem is that your _module_ bootstrap doesn't have the resources
that the _application_ bootstrap had -- and so it's finding no matching
resource to bootstrap.

One workaround is to add this to your configuration:

admin.resources.frontController[] = 

This will grab and return the front controller singleton, which should
work for these purposes.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] ZF1.8 Right way to get zend registry instance

2009-05-07 Thread Mike Wright

Sergio Rinaudo wrote:
Hi, 
I'm wondering if there is any 'best' or 'right' way to get zend registry instance within the zf1.8 bootstrap.

Thanks.


How about:

$registry = Zend_Registry::getInstance();


[fw-general] Refresh meta tag with Zend_Http_Client

2009-05-07 Thread Sudheer Satyanarayana

Hi list,

Is Zend_Http_Client capable of refreshing meta tag? If so, how do I 
achieve it?




--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net



Re: [fw-general] 400 Bad Request

2009-05-07 Thread yidarmy2009

Sorry guys. After all that I figured it out. I just needed to add RewriteBase
/mysite to the .htaccess.

Thanks,

Matt

yidarmy2009 wrote:
> 
> When I goto my application baseUrl ( http://localhost/mysite
> http://localhost/mysite ) it loads up the index/index page exactly as it
> should. However, if I try  http://localhost/mysite/index/index
> http://localhost/mysite/index/index  it gives me a 400 bad request page.
> 
> Whats the best way for me to go about trying to figure out whats causing
> this? I'm running Zend Server CE and I have apache set up like so:
> 
> This httpd.conf is included in the standard httpd.conf
> 
> 
>   Order deny,allow
>   Allow from all
> 
> 
> 
>   AllowOverride All
> 
> 
> Alias /mysite "C:\Program Files\Zend\sites\mysite\public"
> 
> I used to use a virtual host and I am wondering if using an alias has
> something 2 do with it. Additionally, I have the standard .htaccess file
> in my public folder:
> 
> SetEnv APPLICATION_ENV development
> 
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^.*$ - [NC,L]
> RewriteRule ^.*$ index.php [NC,L]
> 
> My actual application was created using zend_tool to keep things as simple
> as possible. So if anyone could give me any advice on what might be
> causing this or what methods I could attempt to find out myself it would
> be greatly appreciated.
> 
> Matt
> 

-- 
View this message in context: 
http://www.nabble.com/400-Bad-Request-tp23432700p23433629.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] ZF1.8 Switching layouts between modules.

2009-05-07 Thread Sergio Rinaudo

Dear list, 
I've almost completed to implement all my past work in the new 
Zend_Application, I still have the problem on how switch layouts between 
modules.  I noticed here you can specify this in the configuration ini file:

http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.modules.configExample

but if I add this line on my ini

admin.resources.layout.layout = "admin"

I get the error

Fatal error:  Uncaught exception 'Zend_Application_Bootstrap_Exception' with 
message 'Resource matching "frontcontroller" not found' in


Does anyone solved this?


Sergio Rinaudo


_
Resta in contatto con gli amici, comunica con Messenger!
http://messenger.it/cominciaAcomunicare.aspx

[fw-general] get Request within Resource_View?

2009-05-07 Thread Philip G
How would one get the Request object within Resource_View or is that even
possible?
The issue I need to solve is dynamically setting the view script path based
on a custom routing rule. Route rule: resources.router.routes.main.route =
":skin/:controller/:action/*" resources.router.routes.main.defaults.skin =
"default" resources.router.routes.main.defaults.controller = "join"
resources.router.routes.main.defaults.action = "index" I need to change the
script path to: $viewRenderer->setViewBasePathSpec( 'views/:skin' );
However, I keep getting: A replacement identifier : was found inside the
inflected target, perhaps a rule was not satisfied with a target source?
It's not understanding ':skin'. Is there some way to get this working right?
I'm attaching the view through the Bootstrap resource method:
$bootstrap->registerPluginResource( new PPC_Application_Resource_View() );



---
Philip
g...@gpcentre.net
http://www.gpcentre.net/


RE: [fw-general] ZF1.8 Naming Convention for rowClass Model

2009-05-07 Thread Sergio Rinaudo

Great, it works!
Hope this issue will correct in the next version of ZF

Thank you


Sergio Rinaudo



> Date: Thu, 7 May 2009 19:24:17 +0100
> From: mute.p...@googlemail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] ZF1.8 Naming Convention for rowClass Model
> 
> 2009/5/7 Sergio Rinaudo :
> > So, what am I suppose to do if I have a situation where I have a
> > Zend_Db_Table_Rowset ( $mymodel->fetchAll() ) and I have to cicle it, and
> > access some Zend_Db_Table_Row method?
> 
> You need to make sure that you have required the row class before
> Zend_Db_Table_*  tries to load it.
> 
> You could also edit the Zend_Loader::loadClass method and change the
> class_exists($class, false) to class_exists($class) but obviously you
> will be editing the core files...
> 
> >
> > Sergio Rinaudo
> >
> >
> >
> >> Date: Thu, 7 May 2009 12:18:32 -0400
> >> From: matt...@zend.com
> >> To: fw-general@lists.zend.com
> >> Subject: Re: [fw-general] ZF1.8 Naming Convention for rowClass Model
> >>
> >> -- Sergio Rinaudo  wrote
> >> (on Thursday, 07 May 2009, 04:32 PM +0200):
> >> > I gets Zend_Loader error when trying to load rowClass model.
> >> > I've already changed the name of my rowClass model in
> >> > Model_{rowclassname},
> >> > same result.
> >> > Any advices?
> >>
> >> There's an issue in the tracker related to this already; I'm not sure if
> >> we'll address it for 1.8.1, or if it will need to wait for a later
> >> maintenance release.
> >>
> >> (We actually need to modify most usage of Zend_Loader internally --
> >> though it's used relatively infrequently -- to allow for autoloading.)
> >>
> >> --
> >> Matthew Weier O'Phinney
> >> Project Lead | matt...@zend.com
> >> Zend Framework | http://framework.zend.com/
> >
> > 
> > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009!
> 
> 
> 
> -- 
> --
> [MuTe]
> --

_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

[fw-general] 400 Bad Request

2009-05-07 Thread yidarmy2009

When I goto my application baseUrl ( http://localhost/mysite
http://localhost/mysite ) it loads up the index/index page exactly as it
should. However, if I try  http://localhost/mysite/index/index
http://localhost/mysite/index/index  it gives me a 400 bad request page.

Whats the best way for me to go about trying to figure out whats causing
this? I'm running Zend Server CE and I have apache set up like so:

This httpd.conf is included in the standard httpd.conf


  Order deny,allow
  Allow from all



AllowOverride All


Alias /mysite "C:\Program Files\Zend\sites\mysite\public"

I used to use a virtual host and I am wondering if using an alias has
something 2 do with it. Additionally, I have the standard .htaccess file in
my public folder:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

My actual application was created using zend_tool to keep things as simple
as possible. So if anyone could give me any advice on what might be causing
this or what methods I could attempt to find out myself it would be greatly
appreciated.

Matt
-- 
View this message in context: 
http://www.nabble.com/400-Bad-Request-tp23432700p23432700.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] ZF1.8 Naming Convention for rowClass Model

2009-05-07 Thread keith Pope
2009/5/7 Sergio Rinaudo :
> So, what am I suppose to do if I have a situation where I have a
> Zend_Db_Table_Rowset ( $mymodel->fetchAll() ) and I have to cicle it, and
> access some Zend_Db_Table_Row method?

You need to make sure that you have required the row class before
Zend_Db_Table_*  tries to load it.

You could also edit the Zend_Loader::loadClass method and change the
class_exists($class, false) to class_exists($class) but obviously you
will be editing the core files...

>
> Sergio Rinaudo
>
>
>
>> Date: Thu, 7 May 2009 12:18:32 -0400
>> From: matt...@zend.com
>> To: fw-general@lists.zend.com
>> Subject: Re: [fw-general] ZF1.8 Naming Convention for rowClass Model
>>
>> -- Sergio Rinaudo  wrote
>> (on Thursday, 07 May 2009, 04:32 PM +0200):
>> > I gets Zend_Loader error when trying to load rowClass model.
>> > I've already changed the name of my rowClass model in
>> > Model_{rowclassname},
>> > same result.
>> > Any advices?
>>
>> There's an issue in the tracker related to this already; I'm not sure if
>> we'll address it for 1.8.1, or if it will need to wait for a later
>> maintenance release.
>>
>> (We actually need to modify most usage of Zend_Loader internally --
>> though it's used relatively infrequently -- to allow for autoloading.)
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead | matt...@zend.com
>> Zend Framework | http://framework.zend.com/
>
> 
> Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009!



-- 
--
[MuTe]
--


Re: [fw-general] Bootstrapping modules

2009-05-07 Thread keith Pope
2009/5/7 Justin Barnes :
> Hi Vadim,
>
> Not sure if this answers your question - but this is my solution to
> bootstrapping and encapsulating modules. I would be happy to hear others
> feedback.
>
> I'm using the following module bootstrap class to bootstrap my modules ... I
> have plans to extend the Module_Bootstrap class to do this automatically
> (similar to how is does autoloading), but in the mean time I have this.
>
> class Module1_Bootstrap extends Zend_Application_Module_Bootstrap
>     {
>     protected function _initModuleConfig()
>     {
>     $moduleConfig = new Zend_Config_Ini(APPLICATION_PATH . '/modules/' .
> $moduleName . '/configs/module.ini', APPLICATION_ENV);
>     Zend_Registry::set($moduleName, $moduleConfig);
>     }
>     }
>
> This is the directory structure of my application. All module configs are
> placed in module/configs/module.ini and loaded via the module bootstrap.
> This allows me to "black box" my modules. I really wish the default module
> acted the same way so I could also encapsulate it's config. But since it
> doesn't all default configs end up in application.ini
>
> /application
>     /configs
>         /application.ini
>     /modules
>         /default
>         /controllers
>         /models
>         /views
>             /services
>         /module1
>                /configs
>                    /module.ini
>                /controllers
>                /models
>                /services
>                /views
>                /bootstrap.php
>         /module2
>                /configs
>                    /module.ini
>                /controllers
>                /models
>                /views
>                /bootstrap.php
>
>
> A thanks to Keith Pope ... Your example store front code got me moving in
> the right direction a few weeks back.

Glad its of some use :)

This is pretty much what me and Matthew were discussing a few weeks
back, were every module will be responsible for its own config. I
would expect Z_App to move in this direction in the future. Obviously
I dont speak for the project so Matthew may be better to confirm this
:)

>
>
>
> On Thu, May 7, 2009 at 3:20 AM, Vadim Gabriel  wrote:
>>
>> Hey,
>>
>> Thanks for that, It's a good start. The reason i want to separate the
>> admin from the other modules is because i will have lots of controllers for
>> each module, Each module will have several layouts, each one has to load
>> different public resources from the public folder so it's important for me
>> to make a complex modeler structure so switching layouts, views, resources,
>> controllers separation and adding more modules at a later time will be
>> easier.
>>
>> Since there are no resources about it, You need to dig trough the PHP
>> files of the ZF to figure out how the ZF works with modules step-by-step
>> that sometimes takes time (too much time).
>>
>> I am still looking to get this done the way i showed above, If your book
>> will cover that area as well then you got yourself  your first buyer and
>> reader.
>>
>> Thanks.
>>
>>
>> On Thu, May 7, 2009 at 11:00 AM, keith Pope 
>> wrote:
>>>
>>> 2009/5/7 Vadim Gabriel :
>>> > OK i have added a bootsrap.php file for each module in the module root
>>> > directory. For some reason it won't load that bootstrap file.
>>> > For example my default module directory is as follows:
>>> >
>>> > -default
>>> > --bootsrap.php
>>> > --controllers
>>> > --layouts
>>> > --views
>>> >
>>> > my bootsrap.php file has the class Default_Bootstrap extends
>>> > Zend_Application_Module_Bootstrap
>>> >
>>> > and it consists of an _initView method which never gets called. but it
>>> > routes to the index controller of the default module. Meaning it works
>>> > just
>>> > with nothing set, not view, no layout no nothing.
>>>
>>> Currently the default module is skipped, look inside the modules
>>> resource to see. Therefore Zend_App assume that the main bootstrap
>>> file is your default bootstrap file. This will change at some point, I
>>> had a conversation with Matthew about it some time ago and there are
>>> various ideas about configuring individual modules.
>>>
>>> I have an example of bootstrapping with modules here:
>>> http://code.google.com/p/zendframeworkstorefront I should be updating
>>> it in the next few weeks to include multiple modules as currently it
>>> has only one. Also I use a route to create the "admin" section rather
>>> than a separate module, this way you can keep all your module code
>>> together in one place.
>>>
>>> Hope that makes sense :)
>>>
>>> >
>>> > Any idea why?
>>> > Thanks.
>>> >
>>> > On Wed, May 6, 2009 at 6:24 PM, Vadim Gabriel 
>>> > wrote:
>>> >>
>>> >> P.S I do not use the Zend_Tool yet since it doesn't support
>>> >> modules...Yet
>>> >> (as far as i know)
>>> >>
>>> >> On Wed, May 6, 2009 at 6:23 PM, Vadim Gabriel 
>>> >> wrote:
>>> >>>
>>> >>> Thanks everyone, I think since there are so many people wondering
>>> >>> about
>>> >>> it

RE: [fw-general] ZF1.8 Naming Convention for rowClass Model

2009-05-07 Thread Sergio Rinaudo

So, what am I suppose to do if I have a situation where I have a 
Zend_Db_Table_Rowset ( $mymodel->fetchAll() ) and I have to cicle it, and 
access some Zend_Db_Table_Row method?

Sergio Rinaudo



> Date: Thu, 7 May 2009 12:18:32 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] ZF1.8 Naming Convention for rowClass Model
> 
> -- Sergio Rinaudo  wrote
> (on Thursday, 07 May 2009, 04:32 PM +0200):
> > I gets Zend_Loader error when trying to load rowClass model.
> > I've already changed the name of my rowClass model in Model_{rowclassname},
> > same result.
> > Any advices?
> 
> There's an issue in the tracker related to this already; I'm not sure if
> we'll address it for 1.8.1, or if it will need to wait for a later
> maintenance release.
> 
> (We actually need to modify most usage of Zend_Loader internally --
> though it's used relatively infrequently -- to allow for autoloading.)
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/

_
Più di 30 stazioni. Ascolta la Radio su Messenger!
http://messenger.it/radioMessenger.aspx

[fw-general] Re: Zend_Captcha example with "click-refresh" button?

2009-05-07 Thread Philip G
On Thu, May 7, 2009 at 11:20 AM, Philip G  wrote:

> I need a solution to update a captcha image, using Zend_Captcha. There
> seems to be a couple things Zend_Form_Element_Captcha does. But, there are
> absolutely no getters for Zend_Captcha for those things (image itself,
> token? session set?).
>
> Is there any solution out there I can look over that uses
> Zend_Form_Element_Captcha in conjunction with Zend_Captcha for reloading of
> images? Image reloading is absolutely required. I don't see anything with
> the ZFW docs about reloading captcha.
>
> Thanks.
>
>
>
Whelp, my apologies. I jumped the gun a git on this one. Turns out the token
is also used as part of the image name (this I just fond out). So, change
the token and image src (token.ext) should suffice, no?

Philip


Re: [fw-general] Zend_Db_Table

2009-05-07 Thread Matthew Weier O'Phinney
-- holografix .  wrote
(on Thursday, 07 May 2009, 05:07 PM +0100):
> Hi
>  
> What's the difference between this ?
>  
> $config = $this->config->db;
> $db= Zend_Db::factory($config);
> ..
> ..
>  Zend_Db_Table::setDefaultAdapter($db);
> vs
>  
> Zend_Db_Table_Abstract::setDefaultAdapter($db);

They're the same, basically. However, the Zend_Db_Table was deprecated
starting in 0.9, so the latter, Zend_Db_Table_Abstract, is the more
appropriate approach.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] FW: ZF1.8 Right way to get zend registry instance

2009-05-07 Thread Matthew Weier O'Phinney
-- Sergio Rinaudo  wrote
(on Thursday, 07 May 2009, 04:39 PM +0200):
> I reply to myself,
> I use to create a registry resource
> 
> 
>
> protected function _initRegistry(){
>   $registry = Zend_Registry::getInstance();
>   $config = new Zend_Config($this->getOptions());
>   $registry->config = $config;
>   return $registry;
> }
> 
> then call
> 
> $registry = $this->getResource('registry');
> 
> where needed
> I also use to store config inside registry.

So, when you use getInstance(), you're getting a singleton instance of
Zend_Registry -- which means that you can use:

Zend_Registry::get('config')

anywhere. 

If you want access to the _bootstrap's_ registry (which is what
getResource() accesses, and which is a unique, non-singleton, instance),
you can grab it from the front controller:

$registry = 
Zend_Controller_Front::getInstance()->getParam('bootstrap')->getContainer();

>From your action controllers, it's actually simpler, as the front
controller parameters are passed as "invoke args" to the action
controller:

$registry = $this->getInvokeArg('bootstrap')->getContainer();

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


[fw-general] Zend_Captcha example with "click-refresh" button?

2009-05-07 Thread Philip G
I need a solution to update a captcha image, using Zend_Captcha. There seems
to be a couple things Zend_Form_Element_Captcha does. But, there are
absolutely no getters for Zend_Captcha for those things (image itself,
token? session set?).

Is there any solution out there I can look over that uses
Zend_Form_Element_Captcha in conjunction with Zend_Captcha for reloading of
images? Image reloading is absolutely required. I don't see anything with
the ZFW docs about reloading captcha.

Thanks.

---
Philip
g...@gpcentre.net
http://www.gpcentre.net/


Re: [fw-general] ZF1.8 Naming Convention for rowClass Model

2009-05-07 Thread Matthew Weier O'Phinney
-- Sergio Rinaudo  wrote
(on Thursday, 07 May 2009, 04:32 PM +0200):
> I gets Zend_Loader error when trying to load rowClass model.
> I've already changed the name of my rowClass model in Model_{rowclassname},
> same result.
> Any advices?

There's an issue in the tracker related to this already; I'm not sure if
we'll address it for 1.8.1, or if it will need to wait for a later
maintenance release.

(We actually need to modify most usage of Zend_Loader internally --
though it's used relatively infrequently -- to allow for autoloading.)

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Extending Zend Framework classes

2009-05-07 Thread Matthew Weier O'Phinney
-- iceangel89  wrote
(on Thursday, 07 May 2009, 06:35 AM -0700):
> 
> what abt other classes? like Zend_Validate?

Zend_Validate defines an interface (Zend_Validate_Interface), and a
standard abstract base class (Zend_Validate_Abstract). These are covered
in the manual.

> Giorgio Sironi wrote:
> > 2009/5/5 iceangel89 
> > > function __construct($var1, $var2 ...) {} with as many variables as i
> > > like?
> > > will my constructor affect the default behaviour of the class?
> > >
> > > eg. function filter($var1, $var2 = 'something') {}
> > 
> > If you define a new filter that implements Zend_Filter_Interface, you can
> > define whatever __construct() method you want, and create internally
> > filters
> > that does the job.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


[fw-general] Zend_Db_Table

2009-05-07 Thread holografix .
Hi

What's the difference between this ?

$config = $this->config->db;
$db= Zend_Db::factory($config);
..
..
 Zend_Db_Table::setDefaultAdapter($db);
vs

Zend_Db_Table_Abstract::setDefaultAdapter($db);
cheers
holo


RE: [fw-general] Get Resources (DB) from Controllers

2009-05-07 Thread Sergio Rinaudo

Or also like this

  $bootstrap = $this->getInvokeArg('bootstrap');
  $resource = $bootstrap->getResource('myResource');

Sergio Rinaudo

Date: Thu, 7 May 2009 17:23:42 +0200
From: pbouli...@alteo.fr
To: fw-general@lists.zend.com
Subject: Re: [fw-general] Get Resources (DB) from Controllers






  


Sorry, i make a mistake, i forget the "t" in "bootstrap" : 



$this->getFrontController()->getParam('bootstrap')->getResource('HereTheResourceYouNeed')






Pierrick Boulière a écrit :
In your
controller (or controller action), you can get the resource you need by
:
  

  

$this->getFrontController()->getParam('boostrap')->getResource('HereTheResourceYouNeed')
  

  

example :
$this->getFrontController()->getParam('boostrap')->getResource('db')
  

  

iceangel89 a écrit :
  

  how can i access resources like the default
db adapter from my controllers?


  

_
Cerca le Parole, gioca su Typectionary!
http://typectionary.it.msn.com/

Re: [fw-general] Get Resources (DB) from Controllers

2009-05-07 Thread Pierrick Boulière

Sorry, i make a mistake, i forget the "t" in "bootstrap" :

$this->getFrontController()->getParam('boo*t*strap')->getResource('HereTheResourceYouNeed') 




Pierrick Boulière a écrit :
In your controller (or controller action), you can get the resource 
you need by :


$this->getFrontController()->getParam('boostrap')->getResource('HereTheResourceYouNeed') 



example : 
$this->getFrontController()->getParam('boostrap')->getResource('db')


iceangel89 a écrit :
how can i access resources like the default db adapter from my 
controllers?
  


Re: [fw-general] Get Resources (DB) from Controllers

2009-05-07 Thread Pierrick Boulière
In your controller (or controller action), you can get the resource you 
need by :


$this->getFrontController()->getParam('boostrap')->getResource('HereTheResourceYouNeed')

example : 
$this->getFrontController()->getParam('boostrap')->getResource('db')


iceangel89 a écrit :

how can i access resources like the default db adapter from my controllers?
  




[fw-general] Get Resources (DB) from Controllers

2009-05-07 Thread iceangel89

how can i access resources like the default db adapter from my controllers?
-- 
View this message in context: 
http://www.nabble.com/Get-Resources-%28DB%29-from-Controllers-tp23428523p23428523.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] FW: ZF1.8 Right way to get zend registry instance

2009-05-07 Thread Sergio Rinaudo






I reply to myself, 
I use to create a registry resource



protected function _initRegistry(){
  $registry = Zend_Registry::getInstance();
  $config = new Zend_Config($this->getOptions());
  $registry->config = $config;
  return $registry;
}

then call

$registry = $this->getResource('registry');

where needed
I also use to store config inside registry.


Sergio Rinaudo
_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

[fw-general] ZF1.8 Naming Convention for rowClass Model

2009-05-07 Thread Sergio Rinaudo

Dear List, 
I gets Zend_Loader error when trying to load rowClass model.
I've already changed the name of my rowClass model in Model_{rowclassname}, 
same result.
Any advices?

Sergio Rinaudo


_
Messenger 2009: scaricalo gratis!
http://messenger.it/

Re: [fw-general] Bootstrapping modules

2009-05-07 Thread Justin Barnes
Hi Vadim,

Not sure if this answers your question - but this is my solution to
bootstrapping and encapsulating modules. I would be happy to hear others
feedback.

I'm using the following module bootstrap class to bootstrap my modules ... I
have plans to extend the Module_Bootstrap class to do this automatically
(similar to how is does autoloading), but in the mean time I have this.

class Module1_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initModuleConfig()
{
$moduleConfig = new Zend_Config_Ini(APPLICATION_PATH . '/modules/' .
$moduleName . '/configs/module.ini', APPLICATION_ENV);
Zend_Registry::set($moduleName, $moduleConfig);
}
}

This is the directory structure of my application. All module configs are
placed in module/configs/module.ini and loaded via the module bootstrap.
This allows me to "black box" my modules. I really wish the default module
acted the same way so I could also encapsulate it's config. But since it
doesn't all default configs end up in application.ini

/application
/configs
/application.ini
/modules
/default
/controllers
/models
/views
/services
/module1
   /configs
   /module.ini
   /controllers
   /models
   /services
   /views
   /bootstrap.php
/module2
   /configs
   /module.ini
   /controllers
   /models
   /views
   /bootstrap.php


A thanks to Keith Pope ... Your
examplestore
front code got me moving in the right direction a few weeks back.



On Thu, May 7, 2009 at 3:20 AM, Vadim Gabriel  wrote:

> Hey,
>
> Thanks for that, It's a good start. The reason i want to separate the admin
> from the other modules is because i will have lots of controllers for each
> module, Each module will have several layouts, each one has to load
> different public resources from the public folder so it's important for me
> to make a complex modeler structure so switching layouts, views, resources,
> controllers separation and adding more modules at a later time will be
> easier.
>
> Since there are no resources about it, You need to dig trough the PHP files
> of the ZF to figure out how the ZF works with modules step-by-step that
> sometimes takes time (too much time).
>
> I am still looking to get this done the way i showed above, If your book
> will cover that area as well then you got yourself  your first buyer and
> reader.
>
> Thanks.
>
>
>
> On Thu, May 7, 2009 at 11:00 AM, keith Pope wrote:
>
>> 2009/5/7 Vadim Gabriel :
>> > OK i have added a bootsrap.php file for each module in the module root
>> > directory. For some reason it won't load that bootstrap file.
>> > For example my default module directory is as follows:
>> >
>> > -default
>> > --bootsrap.php
>> > --controllers
>> > --layouts
>> > --views
>> >
>> > my bootsrap.php file has the class Default_Bootstrap extends
>> > Zend_Application_Module_Bootstrap
>> >
>> > and it consists of an _initView method which never gets called. but it
>> > routes to the index controller of the default module. Meaning it works
>> just
>> > with nothing set, not view, no layout no nothing.
>>
>> Currently the default module is skipped, look inside the modules
>> resource to see. Therefore Zend_App assume that the main bootstrap
>> file is your default bootstrap file. This will change at some point, I
>> had a conversation with Matthew about it some time ago and there are
>> various ideas about configuring individual modules.
>>
>> I have an example of bootstrapping with modules here:
>> http://code.google.com/p/zendframeworkstorefront I should be updating
>> it in the next few weeks to include multiple modules as currently it
>> has only one. Also I use a route to create the "admin" section rather
>> than a separate module, this way you can keep all your module code
>> together in one place.
>>
>> Hope that makes sense :)
>>
>> >
>> > Any idea why?
>> > Thanks.
>> >
>> > On Wed, May 6, 2009 at 6:24 PM, Vadim Gabriel 
>> wrote:
>> >>
>> >> P.S I do not use the Zend_Tool yet since it doesn't support
>> modules...Yet
>> >> (as far as i know)
>> >>
>> >> On Wed, May 6, 2009 at 6:23 PM, Vadim Gabriel 
>> wrote:
>> >>>
>> >>> Thanks everyone, I think since there are so many people wondering
>> about
>> >>> it, A blog post/tutorial will be a good idea *hint Matthew hint* i
>> will take
>> >>> a look at those once i am at the office tomorrow.
>> >>>
>> >>> Vince.
>> >>>
>> >>> On Wed, May 6, 2009 at 5:33 PM, Jurian Sluiman
>> >>>  wrote:
>> 
>>  I think (but am not sure about it) you can add view helper paths in
>> the
>>  module bootstrap. You need to specify them for each module, that's
>> correct.
>>  But it's not much work to have an init me

[fw-general] Re[fw-general] ndering all errors on a Zend_Form in 1

2009-05-07 Thread iceangel89

how can i render all errors of a form in something that i can have in my
Zend_Form?

if possible not to do that in my controller and passing arrays to my view to
render them and so on... so like a place in the form allocated for error
display.
-- 
View this message in context: 
http://www.nabble.com/Rendering-all-errors-on-a-Zend_Form-in-1-%3Cul%3E-tp23426836p23426836.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Extending Zend Framework classes

2009-05-07 Thread iceangel89

what abt other classes? like Zend_Validate?



Giorgio Sironi wrote:
> 
> 2009/5/5 iceangel89 
> 
>> function __construct($var1, $var2 ...) {} with as many variables as i
>> like?
>> will my constructor affect the default behaviour of the class?
>>
>> eg. function filter($var1, $var2 = 'something') {}
>>
> 
> If you define a new filter that implements Zend_Filter_Interface, you can
> define whatever __construct() method you want, and create internally
> filters
> that does the job.
> 
> 
> -- 
> Giorgio Sironi
> Piccolo Principe & Ossigeno Scripter
> http://ossigeno.sourceforge.net
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Extending-Zend-Framework-classes-tp23383837p23426791.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] How to automatically load resources

2009-05-07 Thread Sergio Rinaudo

Ok, 
I reply to myself, models classes must be called like Model_{modelName}.
Hope this helps 

Sergio Rinaudo



From: kaiohken1...@hotmail.com
To: matt...@zend.com; fw-general@lists.zend.com
Date: Thu, 7 May 2009 14:08:30 +0200
Subject: RE: [fw-general] How to automatically  load  resources








Hi, 
thanks for reply.
I tried it but I get always the same error.

Just to let you know, my project is created using Zend_Tool and I've implemeted 
to it just the module management via application.ini.
However, my 'default' module isn't inside the module directory, so this is my 
application tree:

application
-modules
--admin
---controllers
---models
---views
-controllers
-models
-views
-layouts

I also tried on my bootstrap's _initAutoloader method to use both 'Default' and 
'' (empty) namespaces, I still get the same error.

I need to use a model class in my bootstrap to ( try to ) setup Lucene, calling 
an observer class located in 'models', I also used to call 
$this->bootstrap('autoloader'); like you adviced.

Where I do mistake?
Thanks

Sergio Rinaudo




> Date: Thu, 7 May 2009 07:49:44 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] How to automatically  load  resources
> 
> -- Sergio Rinaudo  wrote
> (on Thursday, 07 May 2009, 01:15 PM +0200):
> > I need to load from bootstrap some resources located in my 'models' 
> > directory.
> > But if I try I get
> > 
> > Fatal error: Class '{model}' not found in []\application\Bootstrap.php 
> > on
> > line 201
> > 
> > What to do to include resources located in models dir?
> > 
> > I notice there is a class Zend_Application_Module_Autoloader ( maybe ) for 
> > this
> > purpose, I tried to use it without success
> 
> I'd create a resource method in your bootstrap that defines the resource
> autoloader:
> 
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
> protected function _initAutoloader()
> {
> $loader = new Zend_Application_Module_Autoloader(array(
> 'namespace' => 'Default',
> 'basePath'  => APPLICATION_PATH,
> ));
> }
> }
> 
> The above sets up autoloading for the default module, with a namespace
> of 'Default'. Models will then need a class prefix of 'Default_Model_'.
> 
> Then, in methods where you need to load from models, add the above
> method as a dependency:
> 
> $this->bootstrap('autoloader');
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/

Quali sono le parole più cliccate? Scopri la top!
_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

Re: [fw-general] use part of framework only (zend rest)

2009-05-07 Thread ziadmannan

Even Better! Thanks Matthew.


Matthew Weier O'Phinney-3 wrote:
> 
> -- ziadmannan  wrote
> (on Thursday, 07 May 2009, 04:42 AM -0700):
>> Hi, I am interested in using the ZF REST classes in my project as it
>> seems to
>> be quite good. Is there anyway I can add just the files that I need from
>> ZF
>> rather than having to add the whole of ZF to my project. ZF is quite big,
>> even
>> the minimal version zipped up is almost 4MB so I don't really fancy
>> adding that
>> into my repo just to use a few classes. Thanks Ziad
> 
> We don't offer the components for separate download, though some ZF
> users have provided such functionality at different times. One such
> project is the Packagizer:
> 
> http://epic.codeutopia.net/pack/
> 
> It's not completely current (doesn't have 1.8.0), but for Zend_Rest,
> that won't be an issue.
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/use-part-of-framework-only-%28zend-rest%29-tp23424995p23425488.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] How to automatically load resources

2009-05-07 Thread Sergio Rinaudo

Hi, 
thanks for reply.
I tried it but I get always the same error.

Just to let you know, my project is created using Zend_Tool and I've implemeted 
to it just the module management via application.ini.
However, my 'default' module isn't inside the module directory, so this is my 
application tree:

application
-modules
--admin
---controllers
---models
---views
-controllers
-models
-views
-layouts

I also tried on my bootstrap's _initAutoloader method to use both 'Default' and 
'' (empty) namespaces, I still get the same error.

I need to use a model class in my bootstrap to ( try to ) setup Lucene, calling 
an observer class located in 'models', I also used to call 
$this->bootstrap('autoloader'); like you adviced.

Where I do mistake?
Thanks

Sergio Rinaudo




> Date: Thu, 7 May 2009 07:49:44 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] How to automatically  load  resources
> 
> -- Sergio Rinaudo  wrote
> (on Thursday, 07 May 2009, 01:15 PM +0200):
> > I need to load from bootstrap some resources located in my 'models' 
> > directory.
> > But if I try I get
> > 
> > Fatal error: Class '{model}' not found in []\application\Bootstrap.php 
> > on
> > line 201
> > 
> > What to do to include resources located in models dir?
> > 
> > I notice there is a class Zend_Application_Module_Autoloader ( maybe ) for 
> > this
> > purpose, I tried to use it without success
> 
> I'd create a resource method in your bootstrap that defines the resource
> autoloader:
> 
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
> protected function _initAutoloader()
> {
> $loader = new Zend_Application_Module_Autoloader(array(
> 'namespace' => 'Default',
> 'basePath'  => APPLICATION_PATH,
> ));
> }
> }
> 
> The above sets up autoloading for the default module, with a namespace
> of 'Default'. Models will then need a class prefix of 'Default_Model_'.
> 
> Then, in methods where you need to load from models, add the above
> method as a dependency:
> 
> $this->bootstrap('autoloader');
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/

_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
Yes, I am aware of that. I think the best approach will be to specify for
each module a bootstrap (if there is more then one module and a modules
directory was set) otherwise just use the old way. If it will be possible it
will be even better to have a main application bootstrap and each module
will have a bootstrap file. That way common things will be called in the
main bootstrap and overridden by each module separately by it's bootstrap.

On Thu, May 7, 2009 at 3:01 PM, Tim Brayshaw  wrote:

> On 7 May 2009, at 12:11, Erwin Toze wrote:
>
>  in /application/Bootstrap.php:
>> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
>>   protected function _initView()
>>   {
>>   Zend_Layout::startMVC(array('layoutPath' =>
>> '../application/layouts'));
>>   }
>> }
>>
>>
>> in /application/modules/default/Bootstrap.php:
>> class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
>>   protected function _initView()
>>   {
>>   Zend_Layout::startMVC(array('layout' => 'default'));
>>   }
>> }
>>
>>
>> in /application/modules/admin/Bootstrap.php:
>> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
>>   protected function _initView()
>>   {
>>   Zend_Layout::startMVC(array('layout' => 'admin'));
>>   }
>> }
>>
>> so i expected to have different layout when i go to
>> http://localhost/ //default layout
>> and
>> http://localhost/admin///admin layout
>>
>> but wherever i go i always have the admin layout!!
>>
>> does someone have a solution? did i do something wrong?
>>
>
> One problem could be that the bootstrap class (Default_Bootstrap) for the
> default module isn't run:
>
> <
> http://www.nabble.com/Can%27t-seem-to-load-module-boostraps-in-ZF-1.8-tt23326297.html#a2075
> >
>
> Cheers,
>
> Tim.
>



-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Tim Brayshaw

On 7 May 2009, at 12:11, Erwin Toze wrote:


in /application/Bootstrap.php:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
   protected function _initView()
   {
   Zend_Layout::startMVC(array('layoutPath' =>
'../application/layouts'));
   }
}


in /application/modules/default/Bootstrap.php:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
   protected function _initView()
   {
   Zend_Layout::startMVC(array('layout' => 'default'));
   }
}


in /application/modules/admin/Bootstrap.php:
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
   protected function _initView()
   {
   Zend_Layout::startMVC(array('layout' => 'admin'));
   }
}

so i expected to have different layout when i go to
http://localhost/ //default layout
and
http://localhost/admin///admin layout

but wherever i go i always have the admin layout!!

does someone have a solution? did i do something wrong?


One problem could be that the bootstrap class (Default_Bootstrap) for  
the default module isn't run:





Cheers,

Tim.


Re: [fw-general] use part of framework only (zend rest)

2009-05-07 Thread ziadmannan

Hi Vince,

Thanks, thats just what I wanted. I didn't realise this info was available.
I'll try this out.



vince. wrote:
> 
> Just read about the REST classes dependencies and only those you will need
> to include in order to use the REST classes.
> 
> More info
> http://framework.zend.com/manual/en/requirements.html#requirements.dependencies
> 
> On Thu, May 7, 2009 at 2:42 PM, ziadmannan 
> wrote:
> 
>> Hi, I am interested in using the ZF REST classes in my project as it
>> seems
>> to be quite good. Is there anyway I can add just the files that I need
>> from
>> ZF rather than having to add the whole of ZF to my project. ZF is quite
>> big,
>> even the minimal version zipped up is almost 4MB so I don't really fancy
>> adding that into my repo just to use a few classes. Thanks Ziad
>> --
>> View this message in context: use part of framework only (zend
>> rest)
>> Sent from the Zend Framework mailing list
>> archiveat Nabble.com.
>>
> 
> 
> 
> -- 
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://www.vadimg.co.il/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/use-part-of-framework-only-%28zend-rest%29-tp23424995p23425185.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] use part of framework only (zend rest)

2009-05-07 Thread Matthew Weier O'Phinney
-- ziadmannan  wrote
(on Thursday, 07 May 2009, 04:42 AM -0700):
> Hi, I am interested in using the ZF REST classes in my project as it seems to
> be quite good. Is there anyway I can add just the files that I need from ZF
> rather than having to add the whole of ZF to my project. ZF is quite big, even
> the minimal version zipped up is almost 4MB so I don't really fancy adding 
> that
> into my repo just to use a few classes. Thanks Ziad

We don't offer the components for separate download, though some ZF
users have provided such functionality at different times. One such
project is the Packagizer:

http://epic.codeutopia.net/pack/

It's not completely current (doesn't have 1.8.0), but for Zend_Rest,
that won't be an issue.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] How to automatically load resources

2009-05-07 Thread Matthew Weier O'Phinney
-- Sergio Rinaudo  wrote
(on Thursday, 07 May 2009, 01:15 PM +0200):
> I need to load from bootstrap some resources located in my 'models' directory.
> But if I try I get
> 
> Fatal error: Class '{model}' not found in []\application\Bootstrap.php on
> line 201
> 
> What to do to include resources located in models dir?
> 
> I notice there is a class Zend_Application_Module_Autoloader ( maybe ) for 
> this
> purpose, I tried to use it without success

I'd create a resource method in your bootstrap that defines the resource
autoloader:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoloader()
{
$loader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Default',
'basePath'  => APPLICATION_PATH,
));
}
}

The above sets up autoloading for the default module, with a namespace
of 'Default'. Models will then need a class prefix of 'Default_Model_'.

Then, in methods where you need to load from models, add the above
method as a dependency:

$this->bootstrap('autoloader');

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] use part of framework only (zend rest)

2009-05-07 Thread Vadim Gabriel
Just read about the REST classes dependencies and only those you will need
to include in order to use the REST classes.

More info
http://framework.zend.com/manual/en/requirements.html#requirements.dependencies

On Thu, May 7, 2009 at 2:42 PM, ziadmannan  wrote:

> Hi, I am interested in using the ZF REST classes in my project as it seems
> to be quite good. Is there anyway I can add just the files that I need from
> ZF rather than having to add the whole of ZF to my project. ZF is quite big,
> even the minimal version zipped up is almost 4MB so I don't really fancy
> adding that into my repo just to use a few classes. Thanks Ziad
> --
> View this message in context: use part of framework only (zend 
> rest)
> Sent from the Zend Framework mailing list 
> archiveat Nabble.com.
>



-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Erwin Toze
In a more general way, i expected to have module specific initialization
that override the  /application/Bootstrap.php initializations.
maybe it's not  possible, maybe it was not designed to work like taht..

any idea would be appreciated, thanks!


2009/5/7 Vadim Gabriel 

> It would have been possible if we'd know what module was called inside the
> bootstrap class. But the bootstrap class is being called before the
> dispatcher (i think) and therefor we don't know at that point which module
> is being called.
>
>
> On Thu, May 7, 2009 at 2:27 PM, Karl  wrote:
>
>>  You should rather call $layout = Zend_Layout::getMvcInstance(); in your
>> module bootstraps, but this still doesn't solve the problem.
>> As soon as you apply a different layout to any of your modules, it would
>> seem as though the main layout is overwritten.
>>
>> According to the docs, this is possible by either using
>> $layout->setLayout('admin'); or via the ini as admin.resources.layout.layout
>> = "admin" but I have not yet been able to get this to work.
>>
>> Any ideas would be most welcome.
>>
>> Karl
>>
>>  --
>> *From:* Erwin Toze [mailto:tozer...@gmail.com]
>> *Sent:* 07 May 2009 12:59 PM
>> *To:* Karl
>> *Subject:* Re: [fw-general] Modules using zend_application
>>
>>  2009/5/7 Karl 
>>
>>>  Hi,
>>>
>>> I am still trying to figure out how to have different layouts per module
>>> without overriding my main applications layout, so I unfortunately don't
>>> have examples for you.
>>>
>>
>> I'm also struggling with module specific layout, for instance, if i have:
>>
>> two layout files:
>> /application/layouts/default.phtml
>> /application/layouts/admin.phtml
>>
>> in /application/Bootstrap.php:
>> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
>> protected function _initView()
>> {
>> Zend_Layout::startMVC(array('layoutPath' =>
>> '../application/layouts'));
>> }
>> }
>>
>>
>> in /application/modules/default/Bootstrap.php:
>> class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
>> protected function _initView()
>> {
>> Zend_Layout::startMVC(array('layout' => 'default'));
>> }
>> }
>>
>>
>> in /application/modules/admin/Bootstrap.php:
>> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
>> protected function _initView()
>> {
>> Zend_Layout::startMVC(array('layout' => 'admin'));
>> }
>> }
>>
>> so i expected to have different layout when i go to
>> http://localhost/ //default layout
>> and
>> http://localhost/admin///admin layout
>>
>> but wherever i go i always have the admin layout!!
>>
>> does someone have a solution?
>>
>> Thanks
>>
>>
>
>
> --
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://www.vadimg.co.il/
>
>
>
>


[fw-general] use part of framework only (zend rest)

2009-05-07 Thread ziadmannan

Hi,

I am interested in using the ZF REST classes in my project as it seems to be
quite good. Is there anyway I can add just the files that I need from ZF
rather than having to add the whole of ZF to my project. ZF is quite big,
even the minimal version zipped up is almost 4MB so I don't really fancy
adding that into my repo just to use a few classes.

Thanks
Ziad
-- 
View this message in context: 
http://www.nabble.com/use-part-of-framework-only-%28zend-rest%29-tp23424995p23424995.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
It would have been possible if we'd know what module was called inside the
bootstrap class. But the bootstrap class is being called before the
dispatcher (i think) and therefor we don't know at that point which module
is being called.

On Thu, May 7, 2009 at 2:27 PM, Karl  wrote:

>  You should rather call $layout = Zend_Layout::getMvcInstance(); in your
> module bootstraps, but this still doesn't solve the problem.
> As soon as you apply a different layout to any of your modules, it would
> seem as though the main layout is overwritten.
>
> According to the docs, this is possible by either using
> $layout->setLayout('admin'); or via the ini as admin.resources.layout.layout
> = "admin" but I have not yet been able to get this to work.
>
> Any ideas would be most welcome.
>
> Karl
>
>  --
> *From:* Erwin Toze [mailto:tozer...@gmail.com]
> *Sent:* 07 May 2009 12:59 PM
> *To:* Karl
> *Subject:* Re: [fw-general] Modules using zend_application
>
>  2009/5/7 Karl 
>
>>  Hi,
>>
>> I am still trying to figure out how to have different layouts per module
>> without overriding my main applications layout, so I unfortunately don't
>> have examples for you.
>>
>
> I'm also struggling with module specific layout, for instance, if i have:
>
> two layout files:
> /application/layouts/default.phtml
> /application/layouts/admin.phtml
>
> in /application/Bootstrap.php:
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layoutPath' =>
> '../application/layouts'));
> }
> }
>
>
> in /application/modules/default/Bootstrap.php:
> class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'default'));
> }
> }
>
>
> in /application/modules/admin/Bootstrap.php:
> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'admin'));
> }
> }
>
> so i expected to have different layout when i go to
> http://localhost/ //default layout
> and
> http://localhost/admin///admin layout
>
> but wherever i go i always have the admin layout!!
>
> does someone have a solution?
>
> Thanks
>
>


-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


RE: [fw-general] Modules using zend_application

2009-05-07 Thread Karl
You should rather call $layout = Zend_Layout::getMvcInstance(); in your
module bootstraps, but this still doesn't solve the problem. 
As soon as you apply a different layout to any of your modules, it would
seem as though the main layout is overwritten.
 
According to the docs, this is possible by either using
$layout->setLayout('admin'); or via the ini as admin.resources.layout.layout
= "admin" but I have not yet been able to get this to work.
 
Any ideas would be most welcome.
 
Karl

  _  

From: Erwin Toze [mailto:tozer...@gmail.com] 
Sent: 07 May 2009 12:59 PM
To: Karl
Subject: Re: [fw-general] Modules using zend_application


2009/5/7 Karl 


Hi,


I am still trying to figure out how to have different layouts per module
without overriding my main applications layout, so I unfortunately don't
have examples for you.


I'm also struggling with module specific layout, for instance, if i have:

two layout files:
/application/layouts/default.phtml
/application/layouts/admin.phtml
 
in /application/Bootstrap.php:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layoutPath' =>
'../application/layouts'));
}
}


in /application/modules/default/Bootstrap.php:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layout' => 'default'));
}
}


in /application/modules/admin/Bootstrap.php:
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layout' => 'admin'));
}
}

so i expected to have different layout when i go to
http://localhost/ //default layout
and
http://localhost/admin///admin layout

but wherever i go i always have the admin layout!!

does someone have a solution?

Thanks 




Re: FW: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
How about those who do not use ini file as there config file? and yet we
can't add a whole bunch of code for every module. What about when someone
adds a new module he needs to start adding code blocks into X amount of
places to configure that right. That's not the approach i am searching for.
There should be a better more modulere and convinent solution.

Vince.

On Thu, May 7, 2009 at 2:21 PM, Sergio Rinaudo wrote:

>  Maybe this is the solution.
> On your application.ini add
>
>   {modulename}.resources.frontController.controllerDirectory =
> APPLICATION_PATH "/controllers"
>   {modulename}.resources.frontController.moduleDirectory = APPLICATION_PATH
> "/modules"
>   {modulename}n.resources.frontController.moduleControllerDirectoryName =
> "controllers"
>   {modulename}.resources.frontController.defaultControllerName = "index"
>   {modulename}.resources.frontController.defaultAction = "index"
>   {modulename}.resources.frontController.defaultModule = "default"
>   {modulename}.resources.frontController.baseUrl = "/"
>   {modulename}.resources.layout.layout = "{layoutname}"
>
>
> Sergio Rinaudo
>
>
>
> --
> Date: Thu, 7 May 2009 14:15:28 +0300
> From: vadim...@gmail.com
> To: tozer...@gmail.com
> CC: k...@wedgeonline.co.za; fw-general@lists.zend.com
> Subject: Re: [fw-general] Modules using zend_application
>
> I did the same thing and have the same problem.
>
> On Thu, May 7, 2009 at 2:11 PM, Erwin Toze  wrote:
>
> 2009/5/7 Karl 
>
>  Hi,
>
> I am still trying to figure out how to have different layouts per module
> without overriding my main applications layout, so I unfortunately don't
> have examples for you.
>
>
> I'm also struggling with module specific layout, for instance, if i have:
>
> two layout files:
> /application/layouts/default. phtml
> /application/layouts/admin.phtml
>
> in /application/Bootstrap.php:
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layoutPath' =>
> '../application/layouts'));
> }
> }
>
>
> in /application/modules/default/Bootstrap.php:
> class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'default'));
> }
> }
>
>
> in /application/modules/admin/Bootstrap.php:
> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'admin'));
> }
> }
>
> so i expected to have different layout when i go to
> http://localhost/ //default layout
> and
> http://localhost/admin///admin layout
>
> but wherever i go i always have the admin layout!!
>
> does someone have a solution? did i do something wrong?
>
> Thanks
>
>
>
>
> --
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://www.vadimg.co.il/
>
>
>
>
> --
> Quali sono le parole più cliccate? Scopri la 
> top!
> --
> Cerchi i tuoi spazi? Hotmail va oltre i 5GB. Scopri 
> perché!
>



-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


FW: [fw-general] Modules using zend_application

2009-05-07 Thread Sergio Rinaudo

Maybe this is the solution.
On your application.ini add

  {modulename}.resources.frontController.controllerDirectory = APPLICATION_PATH 
"/controllers"
  {modulename}.resources.frontController.moduleDirectory = APPLICATION_PATH 
"/modules"
  {modulename}n.resources.frontController.moduleControllerDirectoryName = 
"controllers"
  {modulename}.resources.frontController.defaultControllerName = "index"
  {modulename}.resources.frontController.defaultAction = "index"
  {modulename}.resources.frontController.defaultModule = "default"
  {modulename}.resources.frontController.baseUrl = "/"
  {modulename}.resources.layout.layout = "{layoutname}"


Sergio Rinaudo



Date: Thu, 7 May 2009 14:15:28 +0300
From: vadim...@gmail.com
To: tozer...@gmail.com
CC: k...@wedgeonline.co.za; fw-general@lists.zend.com
Subject: Re: [fw-general] Modules using zend_application

I did the same thing and have the same problem.

On Thu, May 7, 2009 at 2:11 PM, Erwin Toze  wrote:

2009/5/7 Karl 









Hi,

I am still trying to figure out how to have 
different layouts per module without overriding my main applications layout, so 
I unfortunately don't have examples for you.
I'm also struggling with module specific layout, for instance, if i have:

two layout files:
/application/layouts/default.

phtml

/application/layouts/admin.phtml
 
in /application/Bootstrap.php:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initView()
{

Zend_Layout::startMVC(array('layoutPath' => '../application/layouts'));


}
}


in /application/modules/default/Bootstrap.php:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layout' => 'default'));



}
}



in /application/modules/admin/Bootstrap.php:

class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {

protected function _initView()

{

Zend_Layout::startMVC(array('layout' => 'admin'));

}

}

so i expected to have different layout when i go to
http://localhost/ //default layout
and
http://localhost/admin///admin layout




but wherever i go i always have the admin layout!!

does someone have a solution? did i do something wrong?

Thanks


-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/






Quali sono le parole più cliccate? Scopri la top!
_
Resta in contatto con gli amici, comunica con Messenger!
http://messenger.it/cominciaAcomunicare.aspx

[fw-general] How to automatically load resources

2009-05-07 Thread Sergio Rinaudo

Hi, 
I need to load from bootstrap some resources located in my 'models' directory.
But if I try I get 

Fatal error:  Class '{model}' not found in []\application\Bootstrap.php on 
line 201

What to do to include resources located in models dir?

I notice there is a class Zend_Application_Module_Autoloader ( maybe ) for this 
purpose, I tried to use it without success

Advices are very appreciated.
Thanks


Sergio Rinaudo

_
Più di 30 stazioni. Ascolta la Radio su Messenger!
http://messenger.it/radioMessenger.aspx

Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
I did the same thing and have the same problem.

On Thu, May 7, 2009 at 2:11 PM, Erwin Toze  wrote:

> 2009/5/7 Karl 
>
>>  Hi,
>>
>> I am still trying to figure out how to have different layouts per module
>> without overriding my main applications layout, so I unfortunately don't
>> have examples for you.
>>
>
> I'm also struggling with module specific layout, for instance, if i have:
>
> two layout files:
> /application/layouts/default. phtml
> /application/layouts/admin.phtml
>
> in /application/Bootstrap.php:
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layoutPath' =>
> '../application/layouts'));
> }
> }
>
>
> in /application/modules/default/Bootstrap.php:
> class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'default'));
> }
> }
>
>
> in /application/modules/admin/Bootstrap.php:
> class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
> protected function _initView()
> {
> Zend_Layout::startMVC(array('layout' => 'admin'));
> }
> }
>
> so i expected to have different layout when i go to
> http://localhost/ //default layout
> and
> http://localhost/admin///admin layout
>
> but wherever i go i always have the admin layout!!
>
> does someone have a solution? did i do something wrong?
>
> Thanks
>



-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Erwin Toze
2009/5/7 Karl 

>  Hi,
>
> I am still trying to figure out how to have different layouts per module
> without overriding my main applications layout, so I unfortunately don't
> have examples for you.
>

I'm also struggling with module specific layout, for instance, if i have:

two layout files:
/application/layouts/default.phtml
/application/layouts/admin.phtml

in /application/Bootstrap.php:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layoutPath' =>
'../application/layouts'));
}
}


in /application/modules/default/Bootstrap.php:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layout' => 'default'));
}
}


in /application/modules/admin/Bootstrap.php:
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {
protected function _initView()
{
Zend_Layout::startMVC(array('layout' => 'admin'));
}
}

so i expected to have different layout when i go to
http://localhost/ //default layout
and
http://localhost/admin///admin layout

but wherever i go i always have the admin layout!!

does someone have a solution? did i do something wrong?

Thanks


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
Hey,

Thanks. This is getting easier now. Do you think there is a way to know
which module is currently loaded in the bootstrap.php file?

Thanks again.

On Thu, May 7, 2009 at 1:14 PM, Karl  wrote:

>  Hi,
>
> Your application/Bootsrap extends Zend_Application_Bootstrap_Bootstrap and
> your module ones extend Zend_Application_Module_Bootstrap so you would not
> be able to extend your module one with the application bootstrap.
>
> I am still trying to figure out how to have different layouts per module
> without overriding my main applications layout, so I unfortunately don't
> have examples for you.
>
> Regards,
> Karl
>
>  --
> *From:* Vadim Gabriel [mailto:vadim...@gmail.com]
> *Sent:* 07 May 2009 11:28 AM
> *To:* Karl
>
> *Cc:* Zend Framework - General
> *Subject:* Re: [fw-general] Modules using zend_application
>
>  Hey,
>
> Thanks for the answers. Could both bootstraps classes share the same
> methods? I assume i could extend modules/admin/bootstrap.php with the
> application/bootstrap.php class? and override methods i will need?
>
> Do you have an example for a bootstrap class that loads
> routes/frontcontroller/helpers/layouts/views/translate/etc.. ??
>
> Thanks again.
>
> On Thu, May 7, 2009 at 12:20 PM, Karl  wrote:
>
>> Hi Vincent
>>  - See response to your questions below. This is what I understand from
>> the
>> modular structure.
>>
>> 
>>
>> From: Vadim Gabriel [mailto:vadim...@gmail.com]
>> Sent: 07 May 2009 11:00 AM
>> To: Mon Zafra
>> Cc: Zend Framework - General
>> Subject: Re: [fw-general] Modules using zend_application
>>
>>
>> Hey,
>>
>> "About the workshop controller problem, that's probably a rewrite issue or
>> a
>> wrong base url setting. "
>>
>> Reading that i was like "yea right..." but then i noticed that i emptied
>> the
>> baseUrl property in the config.php file and therefore it throw that
>> exception. Removing that just worked. And modules are working now. Thanks
>> for that.
>>
>> BTW I do not use the Zend_Tool. But i am glad i got this working.
>>
>>
>> @Karl Thanks for the code snippet. Could you let me know what it used for?
>> If i add it to the Admin module it's being called. Several questions:
>> K >>No idea what you mean. This was a test to get a 'stats' module
>> bootstrap
>> called.
>>
>> 1. Why isn't the default module ('default') bootsrap class called? And the
>> admin module bootstrap file is?
>> >> From what I've managed to figure out, the default module uses your
>> application Bootstrap
>> 2. Why do i need to have 3 bootstrap classes when i only have two modules?
>> >> You'll only need 2.
>> >> one under application/Bootstrap.php instead of having it under
>> /application/modules/default/Bootstrap.php
>> >> and one for your admin module under
>> /application/modules/admin/Bootstrap.php
>> 3. couldn't i use the the contents of application/Bootstrap.php inside
>> application/modules/admin/Bootstrap.php and
>> application/modules/default/Bootstrap.php ? I mean having a bootstrap
>> class
>> for each module?
>> >> The application one will be used for the default module, so you
>> shouldn't
>> have another one under /default
>>
>> Thanks again.
>>
>>
>>
>> On Thu, May 7, 2009 at 11:30 AM, Mon Zafra  wrote:
>>
>>
>>The module bootstraps will not be executed unless the Modules
>> bootstrap resource plugin is enabled. Since (I guess) you're using
>> Zend_Tool
>> now, just add the line 'resources.modules = 1' in application.ini. If you
>> aren't using a config, there are a couple of ways (that I know of) to
>> enable
>> it:
>>
>>1. Via options passed to the Zend_Application constructor:
>>
>>// project/public/index.php
>>$app = new Zend_Application($env, array(
>>'resources' => array(
>>'modules' => array(),
>>// other resource plugins
>>));
>>
>>2. Via the $_pluginResources property of the application bootstrap:
>>
>>// project/application/Bootstrap.php
>>
>>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>>{
>>
>>protected $_pluginResources = array(
>>'modules' => array()
>>);
>>}
>>
>>About the workshop controller problem, that's probably a rewrite
>> issue or a wrong base url setting.
>>
>>   -- Mon
>>
>>
>>
>>On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel 
>> wrote:
>>
>>
>>I was struggling with this, This entire morning with no
>> luck
>> at trying to figure out how to setup a moduler structure and using
>> zend_application and bootstrapping. I have gone to a point where he scans
>> the modules directory, Does not load the bootstrap files located under
>> each
>> module directory root and has the {modulename}_Bootstrap class name, It
>> then
>> tries to load the controller named 'workshop' under the url
>> http://localhost/workshop/pub

RE: [fw-general] Modules using zend_application

2009-05-07 Thread Karl
Hi,
 
Your application/Bootsrap extends Zend_Application_Bootstrap_Bootstrap and
your module ones extend Zend_Application_Module_Bootstrap so you would not
be able to extend your module one with the application bootstrap.
 
I am still trying to figure out how to have different layouts per module
without overriding my main applications layout, so I unfortunately don't
have examples for you.
 
Regards,
Karl

  _  

From: Vadim Gabriel [mailto:vadim...@gmail.com] 
Sent: 07 May 2009 11:28 AM
To: Karl
Cc: Zend Framework - General
Subject: Re: [fw-general] Modules using zend_application


Hey,

Thanks for the answers. Could both bootstraps classes share the same
methods? I assume i could extend modules/admin/bootstrap.php with the
application/bootstrap.php class? and override methods i will need? 

Do you have an example for a bootstrap class that loads
routes/frontcontroller/helpers/layouts/views/translate/etc.. ??

Thanks again. 


On Thu, May 7, 2009 at 12:20 PM, Karl  wrote:


Hi Vincent
 - See response to your questions below. This is what I understand from the
modular structure.




From: Vadim Gabriel [mailto:vadim...@gmail.com]

Sent: 07 May 2009 11:00 AM
To: Mon Zafra
Cc: Zend Framework - General
Subject: Re: [fw-general] Modules using zend_application



Hey,

"About the workshop controller problem, that's probably a rewrite issue or a
wrong base url setting. "

Reading that i was like "yea right..." but then i noticed that i emptied the
baseUrl property in the config.php file and therefore it throw that
exception. Removing that just worked. And modules are working now. Thanks
for that.

BTW I do not use the Zend_Tool. But i am glad i got this working.


@Karl Thanks for the code snippet. Could you let me know what it used for?
If i add it to the Admin module it's being called. Several questions:

K >>No idea what you mean. This was a test to get a 'stats' module bootstrap
called.


1. Why isn't the default module ('default') bootsrap class called? And the
admin module bootstrap file is?

>> From what I've managed to figure out, the default module uses your
application Bootstrap

2. Why do i need to have 3 bootstrap classes when i only have two modules?

>> You'll only need 2.
>> one under application/Bootstrap.php instead of having it under
/application/modules/default/Bootstrap.php
>> and one for your admin module under
/application/modules/admin/Bootstrap.php

3. couldn't i use the the contents of application/Bootstrap.php inside
application/modules/admin/Bootstrap.php and
application/modules/default/Bootstrap.php ? I mean having a bootstrap class
for each module?

>> The application one will be used for the default module, so you shouldn't
have another one under /default


Thanks again.



On Thu, May 7, 2009 at 11:30 AM, Mon Zafra  wrote:


   The module bootstraps will not be executed unless the Modules
bootstrap resource plugin is enabled. Since (I guess) you're using Zend_Tool
now, just add the line 'resources.modules = 1' in application.ini. If you
aren't using a config, there are a couple of ways (that I know of) to enable
it:

   1. Via options passed to the Zend_Application constructor:

   // project/public/index.php
   $app = new Zend_Application($env, array(
   'resources' => array(
   'modules' => array(),
   // other resource plugins
   ));

   2. Via the $_pluginResources property of the application bootstrap:

   // project/application/Bootstrap.php

   class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
   {

   protected $_pluginResources = array(
   'modules' => array()
   );
   }

   About the workshop controller problem, that's probably a rewrite
issue or a wrong base url setting.

  -- Mon



   On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel 
wrote:


   I was struggling with this, This entire morning with no luck
at trying to figure out how to setup a moduler structure and using
zend_application and bootstrapping. I have gone to a point where he scans
the modules directory, Does not load the bootstrap files located under each
module directory root and has the {modulename}_Bootstrap class name, It then
tries to load the controller named 'workshop' under the url
http://localhost/workshop/public which is clearly something it shouldn't do.
And it does that until i add 'useDefaultControllerAlways' to the config file
under the FrontController resource. This is becoming very hard to understand
as time goes by and the ZF project grows bigger. I couldn't find any (good
understanable organized) documentation regarding this approach. If anyone
tried anything like this or has something to share, Please do. It's getting
very agneying task to try and create an application (with modules) using ZF
b/c of the lack of documentation for these issues.

   Thank

[fw-general] ZF1.8 Right way to get zend registry instance

2009-05-07 Thread Sergio Rinaudo

Hi, 
I'm wondering if there is any 'best' or 'right' way to get zend registry 
instance within the zf1.8 bootstrap.
Thanks.

Sergio Rinaudo

_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

[fw-general] ZF1.8 Starting Session using configuration

2009-05-07 Thread Sergio Rinaudo

Hi, 
I have this configuration for the session resource in my application.ini

  resources.session.save_path = APPLICATION_PATH "/../data/session"
  resources.session.use_only_cookies = true
  resources.session.remember_me_seconds = 864000

and I want to start session in my bootstrap.
I'm reading the documentation about this step 
http://framework.zend.com/manual/en/zend.application.available-resources.html ( 
4.6.4 ) but I didn't get how to instanciate the session within the Zend 
Application Bootstrap and pass to it all the ini parameters.

Any example?
Than you

Sergio Rinaudo

_
Più di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
Hey,

Thanks for the answers. Could both bootstraps classes share the same
methods? I assume i could extend modules/admin/bootstrap.php with the
application/bootstrap.php class? and override methods i will need?

Do you have an example for a bootstrap class that loads
routes/frontcontroller/helpers/layouts/views/translate/etc.. ??

Thanks again.

On Thu, May 7, 2009 at 12:20 PM, Karl  wrote:

> Hi Vincent
>  - See response to your questions below. This is what I understand from the
> modular structure.
>
> 
>
> From: Vadim Gabriel [mailto:vadim...@gmail.com]
> Sent: 07 May 2009 11:00 AM
> To: Mon Zafra
> Cc: Zend Framework - General
> Subject: Re: [fw-general] Modules using zend_application
>
>
> Hey,
>
> "About the workshop controller problem, that's probably a rewrite issue or
> a
> wrong base url setting. "
>
> Reading that i was like "yea right..." but then i noticed that i emptied
> the
> baseUrl property in the config.php file and therefore it throw that
> exception. Removing that just worked. And modules are working now. Thanks
> for that.
>
> BTW I do not use the Zend_Tool. But i am glad i got this working.
>
>
> @Karl Thanks for the code snippet. Could you let me know what it used for?
> If i add it to the Admin module it's being called. Several questions:
> K >>No idea what you mean. This was a test to get a 'stats' module
> bootstrap
> called.
>
> 1. Why isn't the default module ('default') bootsrap class called? And the
> admin module bootstrap file is?
> >> From what I've managed to figure out, the default module uses your
> application Bootstrap
> 2. Why do i need to have 3 bootstrap classes when i only have two modules?
> >> You'll only need 2.
> >> one under application/Bootstrap.php instead of having it under
> /application/modules/default/Bootstrap.php
> >> and one for your admin module under
> /application/modules/admin/Bootstrap.php
> 3. couldn't i use the the contents of application/Bootstrap.php inside
> application/modules/admin/Bootstrap.php and
> application/modules/default/Bootstrap.php ? I mean having a bootstrap class
> for each module?
> >> The application one will be used for the default module, so you
> shouldn't
> have another one under /default
>
> Thanks again.
>
>
>
> On Thu, May 7, 2009 at 11:30 AM, Mon Zafra  wrote:
>
>
>The module bootstraps will not be executed unless the Modules
> bootstrap resource plugin is enabled. Since (I guess) you're using
> Zend_Tool
> now, just add the line 'resources.modules = 1' in application.ini. If you
> aren't using a config, there are a couple of ways (that I know of) to
> enable
> it:
>
>1. Via options passed to the Zend_Application constructor:
>
>// project/public/index.php
>$app = new Zend_Application($env, array(
>'resources' => array(
>'modules' => array(),
>// other resource plugins
>));
>
>2. Via the $_pluginResources property of the application bootstrap:
>
>// project/application/Bootstrap.php
>
>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>{
>
>protected $_pluginResources = array(
>'modules' => array()
>);
>}
>
>About the workshop controller problem, that's probably a rewrite
> issue or a wrong base url setting.
>
>   -- Mon
>
>
>
>On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel 
> wrote:
>
>
>I was struggling with this, This entire morning with no luck
> at trying to figure out how to setup a moduler structure and using
> zend_application and bootstrapping. I have gone to a point where he scans
> the modules directory, Does not load the bootstrap files located under each
> module directory root and has the {modulename}_Bootstrap class name, It
> then
> tries to load the controller named 'workshop' under the url
> http://localhost/workshop/public which is clearly something it shouldn't
> do.
> And it does that until i add 'useDefaultControllerAlways' to the config
> file
> under the FrontController resource. This is becoming very hard to
> understand
> as time goes by and the ZF project grows bigger. I couldn't find any (good
> understanable organized) documentation regarding this approach. If anyone
> tried anything like this or has something to share, Please do. It's getting
> very agneying task to try and create an application (with modules) using ZF
> b/c of the lack of documentation for these issues.
>
>Thanks.
>
>--
>Vincent Gabriel.
>Lead Developer, Senior Support.
>Zend Certified Engineer.
>Zend Framework Certified Engineer.
>-- http://www.vadimg.co.il/
>
>
>
>
>
>
>
>
>
> --
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://ww

RE: [fw-general] Modules using zend_application

2009-05-07 Thread Karl
Hi Vincent
 - See response to your questions below. This is what I understand from the
modular structure.



From: Vadim Gabriel [mailto:vadim...@gmail.com] 
Sent: 07 May 2009 11:00 AM
To: Mon Zafra
Cc: Zend Framework - General
Subject: Re: [fw-general] Modules using zend_application


Hey,

"About the workshop controller problem, that's probably a rewrite issue or a
wrong base url setting. "

Reading that i was like "yea right..." but then i noticed that i emptied the
baseUrl property in the config.php file and therefore it throw that
exception. Removing that just worked. And modules are working now. Thanks
for that.

BTW I do not use the Zend_Tool. But i am glad i got this working.


@Karl Thanks for the code snippet. Could you let me know what it used for?
If i add it to the Admin module it's being called. Several questions: 
K >>No idea what you mean. This was a test to get a 'stats' module bootstrap
called. 

1. Why isn't the default module ('default') bootsrap class called? And the
admin module bootstrap file is?
>> From what I've managed to figure out, the default module uses your
application Bootstrap
2. Why do i need to have 3 bootstrap classes when i only have two modules?
>> You'll only need 2.
>> one under application/Bootstrap.php instead of having it under
/application/modules/default/Bootstrap.php 
>> and one for your admin module under
/application/modules/admin/Bootstrap.php
3. couldn't i use the the contents of application/Bootstrap.php inside
application/modules/admin/Bootstrap.php and
application/modules/default/Bootstrap.php ? I mean having a bootstrap class
for each module?
>> The application one will be used for the default module, so you shouldn't
have another one under /default

Thanks again.



On Thu, May 7, 2009 at 11:30 AM, Mon Zafra  wrote:


The module bootstraps will not be executed unless the Modules
bootstrap resource plugin is enabled. Since (I guess) you're using Zend_Tool
now, just add the line 'resources.modules = 1' in application.ini. If you
aren't using a config, there are a couple of ways (that I know of) to enable
it:

1. Via options passed to the Zend_Application constructor:

// project/public/index.php
$app = new Zend_Application($env, array(
'resources' => array(
'modules' => array(),
// other resource plugins
));

2. Via the $_pluginResources property of the application bootstrap:

// project/application/Bootstrap.php 

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

protected $_pluginResources = array(
'modules' => array()
);
}

About the workshop controller problem, that's probably a rewrite
issue or a wrong base url setting. 

   -- Mon 



On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel 
wrote:


I was struggling with this, This entire morning with no luck
at trying to figure out how to setup a moduler structure and using
zend_application and bootstrapping. I have gone to a point where he scans
the modules directory, Does not load the bootstrap files located under each
module directory root and has the {modulename}_Bootstrap class name, It then
tries to load the controller named 'workshop' under the url
http://localhost/workshop/public which is clearly something it shouldn't do.
And it does that until i add 'useDefaultControllerAlways' to the config file
under the FrontController resource. This is becoming very hard to understand
as time goes by and the ZF project grows bigger. I couldn't find any (good
understanable organized) documentation regarding this approach. If anyone
tried anything like this or has something to share, Please do. It's getting
very agneying task to try and create an application (with modules) using ZF
b/c of the lack of documentation for these issues.

Thanks.
 
-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/









-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/







Re: [fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
Hey,

"About the workshop controller problem, that's probably a rewrite issue or a
wrong base url setting. "

Reading that i was like "yea right..." but then i noticed that i emptied the
baseUrl property in the config.php file and therefore it throw that
exception. Removing that just worked. And modules are working now. Thanks
for that.

BTW I do not use the Zend_Tool. But i am glad i got this working.


@Karl Thanks for the code snippet. Could you let me know what it used for?
If i add it to the Admin module it's being called. Several questions:

1. Why isn't the default module ('default') bootsrap class called? And the
admin module bootstrap file is?
2. Why do i need to have 3 bootstrap classes when i only have two modules?
3. couldn't i use the the contents of application/Bootstrap.php inside
application/modules/admin/Bootstrap.php and
application/modules/default/Bootstrap.php ? I mean having a bootstrap class
for each module?

Thanks again.


On Thu, May 7, 2009 at 11:30 AM, Mon Zafra  wrote:

> The module bootstraps will not be executed unless the Modules bootstrap
> resource plugin is enabled. Since (I guess) you're using Zend_Tool now, just
> add the line 'resources.modules = 1' in application.ini. If you aren't using
> a config, there are a couple of ways (that I know of) to enable it:
>
> 1. Via options passed to the Zend_Application constructor:
>
> // project/public/index.php
> $app = new Zend_Application($env, array(
> 'resources' => array(
> 'modules' => array(),
> // other resource plugins
> ));
>
> 2. Via the $_pluginResources property of the application bootstrap:
>
> // project/application/Bootstrap.php
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
> protected $_pluginResources = array(
> 'modules' => array()
> );
> }
>
> About the workshop controller problem, that's probably a rewrite issue or a
> wrong base url setting.
>
>-- Mon
>
>
>
> On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel  wrote:
>
>> I was struggling with this, This entire morning with no luck at trying to
>> figure out how to setup a moduler structure and using zend_application and
>> bootstrapping. I have gone to a point where he scans the modules directory,
>> Does not load the bootstrap files located under each module directory root
>> and has the {modulename}_Bootstrap class name, It then tries to load the
>> controller named 'workshop' under the url
>> http://localhost/workshop/public which is clearly something it shouldn't
>> do. And it does that until i add 'useDefaultControllerAlways' to the config
>> file under the FrontController resource. This is becoming very hard to
>> understand as time goes by and the ZF project grows bigger. I couldn't find
>> any (good understanable organized) documentation regarding this approach. If
>> anyone tried anything like this or has something to share, Please do. It's
>> getting very agneying task to try and create an application (with modules)
>> using ZF b/c of the lack of documentation for these issues.
>>
>> Thanks.
>>
>> --
>> Vincent Gabriel.
>> Lead Developer, Senior Support.
>> Zend Certified Engineer.
>> Zend Framework Certified Engineer.
>> -- http://www.vadimg.co.il/
>>
>>
>>
>>
>


-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Modules using zend_application

2009-05-07 Thread Mon Zafra
The module bootstraps will not be executed unless the Modules bootstrap
resource plugin is enabled. Since (I guess) you're using Zend_Tool now, just
add the line 'resources.modules = 1' in application.ini. If you aren't using
a config, there are a couple of ways (that I know of) to enable it:

1. Via options passed to the Zend_Application constructor:

// project/public/index.php
$app = new Zend_Application($env, array(
'resources' => array(
'modules' => array(),
// other resource plugins
));

2. Via the $_pluginResources property of the application bootstrap:

// project/application/Bootstrap.php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected $_pluginResources = array(
'modules' => array()
);
}

About the workshop controller problem, that's probably a rewrite issue or a
wrong base url setting.

   -- Mon


On Thu, May 7, 2009 at 3:59 PM, Vadim Gabriel  wrote:

> I was struggling with this, This entire morning with no luck at trying to
> figure out how to setup a moduler structure and using zend_application and
> bootstrapping. I have gone to a point where he scans the modules directory,
> Does not load the bootstrap files located under each module directory root
> and has the {modulename}_Bootstrap class name, It then tries to load the
> controller named 'workshop' under the url 
> http://localhost/workshop/publicwhich is clearly something it shouldn't do. 
> And it does that until i add
> 'useDefaultControllerAlways' to the config file under the FrontController
> resource. This is becoming very hard to understand as time goes by and the
> ZF project grows bigger. I couldn't find any (good understanable organized)
> documentation regarding this approach. If anyone tried anything like this or
> has something to share, Please do. It's getting very agneying task to try
> and create an application (with modules) using ZF b/c of the lack of
> documentation for these issues.
>
> Thanks.
>
> --
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://www.vadimg.co.il/
>
>
>
>


RE: [fw-general] Modules using zend_application

2009-05-07 Thread Karl
Hi Vincent,
 
This is how I managed to get it working.
 
extract from .ini
# Bootstrapping
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
 
# Front Controller
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "default"
 
resources.modules[] = 
 
Bootstrap classes:
application/Bootstrap.php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initHelpers()
   {
   $frontController = Zend_Controller_Front::getInstance();
   $frontController->addModuleDirectory(APPLICATION_PATH.'/modules');
   $modules = $frontController->getControllerDirectory();
  foreach($modules as $name => $path) {
 $autoloader = new Zend_Application_Module_Autoloader( array(
'namespace' => ucfirst($name).'_',
'basePath'  => APPLICATION_PATH . "/modules/$name"
  ));
Zend_Controller_Action_HelperBroker::addPath($path, ucfirst($name) .
'_Helper');
  }
   }
}
 
application/modules/stats/Bootstrap.php
class Stats_Bootstrap extends Zend_Application_Module_Bootstrap 
{ 
public function __construct($application) 
{ 
 parent::__construct($application); 
}
}
 
If I recall, I was having the same issue as you, untill I added the
$frontController->addModuleDirectory(APPLICATION_PATH.'/modules'); into my
default bootstrap.
 
Hope this helps,
Karl


  _  

From: Vadim Gabriel [mailto:vadim...@gmail.com] 
Sent: 07 May 2009 09:59 AM
To: Nabble Zend Framework General
Subject: [fw-general] Modules using zend_application


I was struggling with this, This entire morning with no luck at trying to
figure out how to setup a moduler structure and using zend_application and
bootstrapping. I have gone to a point where he scans the modules directory,
Does not load the bootstrap files located under each module directory root
and has the {modulename}_Bootstrap class name, It then tries to load the
controller named 'workshop' under the url http://localhost/workshop/public
which is clearly something it shouldn't do. And it does that until i add
'useDefaultControllerAlways' to the config file under the FrontController
resource. This is becoming very hard to understand as time goes by and the
ZF project grows bigger. I couldn't find any (good understanable organized)
documentation regarding this approach. If anyone tried anything like this or
has something to share, Please do. It's getting very agneying task to try
and create an application (with modules) using ZF b/c of the lack of
documentation for these issues.

Thanks.
 
-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/






Re: [fw-general] Bootstrapping modules

2009-05-07 Thread Vadim Gabriel
Hey,

Thanks for that, It's a good start. The reason i want to separate the admin
from the other modules is because i will have lots of controllers for each
module, Each module will have several layouts, each one has to load
different public resources from the public folder so it's important for me
to make a complex modeler structure so switching layouts, views, resources,
controllers separation and adding more modules at a later time will be
easier.

Since there are no resources about it, You need to dig trough the PHP files
of the ZF to figure out how the ZF works with modules step-by-step that
sometimes takes time (too much time).

I am still looking to get this done the way i showed above, If your book
will cover that area as well then you got yourself  your first buyer and
reader.

Thanks.


On Thu, May 7, 2009 at 11:00 AM, keith Pope wrote:

> 2009/5/7 Vadim Gabriel :
> > OK i have added a bootsrap.php file for each module in the module root
> > directory. For some reason it won't load that bootstrap file.
> > For example my default module directory is as follows:
> >
> > -default
> > --bootsrap.php
> > --controllers
> > --layouts
> > --views
> >
> > my bootsrap.php file has the class Default_Bootstrap extends
> > Zend_Application_Module_Bootstrap
> >
> > and it consists of an _initView method which never gets called. but it
> > routes to the index controller of the default module. Meaning it works
> just
> > with nothing set, not view, no layout no nothing.
>
> Currently the default module is skipped, look inside the modules
> resource to see. Therefore Zend_App assume that the main bootstrap
> file is your default bootstrap file. This will change at some point, I
> had a conversation with Matthew about it some time ago and there are
> various ideas about configuring individual modules.
>
> I have an example of bootstrapping with modules here:
> http://code.google.com/p/zendframeworkstorefront I should be updating
> it in the next few weeks to include multiple modules as currently it
> has only one. Also I use a route to create the "admin" section rather
> than a separate module, this way you can keep all your module code
> together in one place.
>
> Hope that makes sense :)
>
> >
> > Any idea why?
> > Thanks.
> >
> > On Wed, May 6, 2009 at 6:24 PM, Vadim Gabriel 
> wrote:
> >>
> >> P.S I do not use the Zend_Tool yet since it doesn't support
> modules...Yet
> >> (as far as i know)
> >>
> >> On Wed, May 6, 2009 at 6:23 PM, Vadim Gabriel 
> wrote:
> >>>
> >>> Thanks everyone, I think since there are so many people wondering about
> >>> it, A blog post/tutorial will be a good idea *hint Matthew hint* i will
> take
> >>> a look at those once i am at the office tomorrow.
> >>>
> >>> Vince.
> >>>
> >>> On Wed, May 6, 2009 at 5:33 PM, Jurian Sluiman
> >>>  wrote:
> 
>  I think (but am not sure about it) you can add view helper paths in
> the
>  module bootstrap. You need to specify them for each module, that's
> correct.
>  But it's not much work to have an init method in each bootstrap class
> adding
>  a path to the view (only some duplicated code...).
> 
>  --
>  Jurian Sluiman
>  Soflomo.com
> 
>  Op Wednesday 06 May 2009 16:27:31 schreef Karl:
>  > Hi,
>  >
>  > I've been trying to configure the same setup as mentioned and was
>  > having
>  > issues trying to get my view helpers registered in the modules. You
>  > will
>  > have to register your view helper paths in each modules bootstrap
>  > file.
>  >
>  > regards,
>  > Karl
>  >
>  > _
>  >
>  > From: Jurian Sluiman [mailto:subscr...@juriansluiman.nl]
>  > Sent: 06 May 2009 04:03 PM
>  > To: fw-general@lists.zend.com
>  > Subject: Re: [fw-general] Bootstrapping modules
>  >
>  > Op Wednesday 06 May 2009 14:57:00 schreef Vadim Gabriel:
>  > > Hey,
>  > >
>  > > Are there any tutorials/guides out there that show examples on
> ways
>  > > to
>  > > bootstrap an application using more then one module? I mean if i
>  > > have a
>  > > directory structure like this:
>  > >
>  > > -library
>  > > ---Zend
>  > > -public
>  > > ---admin
>  > > -default
>  > > -other
>  > > ---site
>  > > -default
>  > > -other
>  > > ---index.php
>  > > -application
>  > > ---configs
>  > > -application.ini
>  > > ---modules
>  > > -admin
>  > > ---controllers
>  > > ---layouts
>  > > -scripts
>  > > ---default
>  > > ---other
>  > > ---views
>  > > -scripts
>  > > ---default
>  > > ---other
>  > > -helpers
>  > > -site
>  > > ---controllers
>  > > ---layouts
>  > > -scripts
>  > > ---default
>  > > ---other
>  > > ---views
>  > > -scripts
>  >

Re: [fw-general] Bootstrapping modules

2009-05-07 Thread keith Pope
2009/5/7 Vadim Gabriel :
> OK i have added a bootsrap.php file for each module in the module root
> directory. For some reason it won't load that bootstrap file.
> For example my default module directory is as follows:
>
> -default
> --bootsrap.php
> --controllers
> --layouts
> --views
>
> my bootsrap.php file has the class Default_Bootstrap extends
> Zend_Application_Module_Bootstrap
>
> and it consists of an _initView method which never gets called. but it
> routes to the index controller of the default module. Meaning it works just
> with nothing set, not view, no layout no nothing.

Currently the default module is skipped, look inside the modules
resource to see. Therefore Zend_App assume that the main bootstrap
file is your default bootstrap file. This will change at some point, I
had a conversation with Matthew about it some time ago and there are
various ideas about configuring individual modules.

I have an example of bootstrapping with modules here:
http://code.google.com/p/zendframeworkstorefront I should be updating
it in the next few weeks to include multiple modules as currently it
has only one. Also I use a route to create the "admin" section rather
than a separate module, this way you can keep all your module code
together in one place.

Hope that makes sense :)

>
> Any idea why?
> Thanks.
>
> On Wed, May 6, 2009 at 6:24 PM, Vadim Gabriel  wrote:
>>
>> P.S I do not use the Zend_Tool yet since it doesn't support modules...Yet
>> (as far as i know)
>>
>> On Wed, May 6, 2009 at 6:23 PM, Vadim Gabriel  wrote:
>>>
>>> Thanks everyone, I think since there are so many people wondering about
>>> it, A blog post/tutorial will be a good idea *hint Matthew hint* i will take
>>> a look at those once i am at the office tomorrow.
>>>
>>> Vince.
>>>
>>> On Wed, May 6, 2009 at 5:33 PM, Jurian Sluiman
>>>  wrote:

 I think (but am not sure about it) you can add view helper paths in the
 module bootstrap. You need to specify them for each module, that's correct.
 But it's not much work to have an init method in each bootstrap class 
 adding
 a path to the view (only some duplicated code...).

 --
 Jurian Sluiman
 Soflomo.com

 Op Wednesday 06 May 2009 16:27:31 schreef Karl:
 > Hi,
 >
 > I've been trying to configure the same setup as mentioned and was
 > having
 > issues trying to get my view helpers registered in the modules. You
 > will
 > have to register your view helper paths in each modules bootstrap
 > file.
 >
 > regards,
 > Karl
 >
 > _
 >
 > From: Jurian Sluiman [mailto:subscr...@juriansluiman.nl]
 > Sent: 06 May 2009 04:03 PM
 > To: fw-general@lists.zend.com
 > Subject: Re: [fw-general] Bootstrapping modules
 >
 > Op Wednesday 06 May 2009 14:57:00 schreef Vadim Gabriel:
 > > Hey,
 > >
 > > Are there any tutorials/guides out there that show examples on ways
 > > to
 > > bootstrap an application using more then one module? I mean if i
 > > have a
 > > directory structure like this:
 > >
 > > -library
 > > ---Zend
 > > -public
 > > ---admin
 > > -default
 > > -other
 > > ---site
 > > -default
 > > -other
 > > ---index.php
 > > -application
 > > ---configs
 > > -application.ini
 > > ---modules
 > > -admin
 > > ---controllers
 > > ---layouts
 > > -scripts
 > > ---default
 > > ---other
 > > ---views
 > > -scripts
 > > ---default
 > > ---other
 > > -helpers
 > > -site
 > > ---controllers
 > > ---layouts
 > > -scripts
 > > ---default
 > > ---other
 > > ---views
 > > -scripts
 > > ---default
 > > ---other
 > > -helpers
 > >
 > > Basically i am looking for creating a modeler structure application
 > > using
 > > ZF 1.8, Is there anything blogged about it?
 > >
 > > Thanks.
 >
 > Hi Vadim,
 > I have looked into this problem as well. It isn't mentioned in the
 > manual,
 > but it's very simple. You should add a Bootstrap.php in each module
 > root
 > containing the class {ModuleName}_Bootstrap, e.g. Admin_Bootstrap, and
 > extending it from Zend_Application_Module_Bootstrap.
 > Now make sure you initialise the modules resource in the global
 > bootstrap
 > class by adding this to your application.ini (if you pass a
 > Zend_Config
 > object when creating the Zend_Application instance):
 > resources.modules[] =
 >
 >
 >
 >
 >
 > Now you should have a proper modular design with autoloading the
 > modules
 > using the conventional structure.
 >
 >
 >
 >
 >
 > Regards, Jurian
>>>
>>>
>>> --
>>> Vincent Gabriel.
>>> Le

[fw-general] Modules using zend_application

2009-05-07 Thread Vadim Gabriel
I was struggling with this, This entire morning with no luck at trying to
figure out how to setup a moduler structure and using zend_application and
bootstrapping. I have gone to a point where he scans the modules directory,
Does not load the bootstrap files located under each module directory root
and has the {modulename}_Bootstrap class name, It then tries to load the
controller named 'workshop' under the url
http://localhost/workshop/publicwhich is clearly something it
shouldn't do. And it does that until i add
'useDefaultControllerAlways' to the config file under the FrontController
resource. This is becoming very hard to understand as time goes by and the
ZF project grows bigger. I couldn't find any (good understanable organized)
documentation regarding this approach. If anyone tried anything like this or
has something to share, Please do. It's getting very agneying task to try
and create an application (with modules) using ZF b/c of the lack of
documentation for these issues.

Thanks.

-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/