Re: [fw-general] Controller flow changes when using render() inside controller action

2009-06-08 Thread agatone

What i mean in all this is :
If i don't change what script to render and leave it to find script to
render byitself the flow is that every postDispatch() (controllers and
plugins) is called before the render of view sscript.

As soon as i try to render myown script postDispatch() is called after
render of the view.

In all this i am looking something that I can use just to tell what should
be rendered and not to alter the flow - keep it same as if i wouldnt change
the view script.

All this solutions adding new stuff on it is way to much work for something
simple :|


Mon Zafra wrote:
 
 Indeed, the plugin postDispatch() is invoked after the helper postDispatch
 (the ViewRenderer is a helper) where the rendering happens. If you need
 stuff to happen after the action but before rendering, it must be in a
 controller postDispatch or a helper postDispatch with a higher priority
 than
 ViewRenderer. Thankfully, the ViewRenderer has a very low priority so just
 add the helper through the HelperBroker and you can be sure it would be
 invoked before the ViewRenderer.
 
 Zend_Controller_Action_HelperBroker::addHelper(new My_Helper());
 
 class My_Helper extends Zend_Controller_Action_Helper_Abstract
 {
 public function postDispatch()
 { /* pre-render logic here */ }
 }
 
-- Mon
 
 
 On Mon, Jun 8, 2009 at 4:42 PM, agatone zoran.z...@gmail.com wrote:
 

 
 

-- 
View this message in context: 
http://www.nabble.com/Controller-flow-changes-when-using-render%28%29-inside-controller-action-tp23915931p23921673.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Controller flow changes when using render() inside controller action

2009-06-08 Thread agatone

Sorry, yes you are right. PostDispatch of plugin always occours after the
rendering of the view.
I'll try the solution with adding helper, thank you.
I hoped i can solve it directily in the plugin.

thanks


Mon Zafra wrote:
 
 That's not true. The plugin postDispatch always occurs after the
 rendering.
 It doesn't matter if you manually render in the controller or let the
 ViewRenderer render. The plugin postDispatch will still be called
 afterward.
 You are also not altering the application flow by changing the action
 script
 in the ViewRenderer. You're simply changing the value of an instance
 member.
 And I believe that's exactly what you want. I'm not sure what led you to
 believe that the flow is altered, but perhaps you could share with us some
 code so we could see what's happening.
 
-- Mon
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Controller-flow-changes-when-using-render%28%29-inside-controller-action-tp23915931p23929707.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Controller flow changes when using render() inside controller action

2009-06-07 Thread agatone

I have a controller action that picks out what script is going to render. So
I use render('scriptname.phtml') inside my action. There is scenario where I
have to alter some view scripts and i do that inside controller's
postDispatch() method - since i want it for all actions inside that
controller. But in combination with the render() inside action,
postDispatch() gets executed when view already rendered. If i don't use
render() then postDispatch() is executed before the view rendering. 
My guess is that that is kinda wrong - in a way - since actual rendereing
should allways be done at the same point of the execution flow in this case
always after postDispatch() - no matter what.

Is there a way to only set the name of script to be rendered later? If not
then I guess I'll have to handle that on my own with some property of the
controller and have some controller plugin with postDispatch() that calls
render with that value.

ty
-- 
View this message in context: 
http://www.nabble.com/Controller-flow-changes-when-using-render%28%29-inside-controller-action-tp23915931p23915931.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: Re: [fw-general] Tags for the memcached and APC backends for Zend_Cache - new approach

2008-11-06 Thread agatone

Hello,

I'm sorry for replying to older post but I need to clear some things.

I don't understand how this TwoLevels cache should work and I see some odd
results quick tests.
Is that it will use fast cache for untagged entries, and slow for tagged
entries? Cuz sometimes I see both entries in APC and in SQLite
Sometimes I see it only in SQLite.

My quick testing using TwoLevels, showed that application became much slower
than without the cache.
I used APC-SQLite.

And sometimes it throws fatal erros when it tries to access cached data as
array although it's object.
Check file TwoLevels.php on line 206 (or so)


Fabien MARTY wrote:
 
 Hi,
 
 Please have a look at the TwoLevels backend in 1.7 trunk (or in 1.7
 PR), it's want you want.
 
 It does exactly this.
 
 Feedback welcome
 
 Regards,
 
 Fabien
 
 
 Fabien MARTY
 [EMAIL PROTECTED]
 
 

-- 
View this message in context: 
http://www.nabble.com/Tags-for-the-memcached-and-APC-backends-for-Zend_Cache---new-approach-tp20109068p20361612.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] contextSwitch AjaxContent

2008-08-11 Thread agatone

So nobody knows anything ? never used it ?


agatone wrote:
 
 Hi,
 
 I'm trying to use contextSwitch (or AjaxSwitch) as i want for some action
 to be accessible in JSON format.
 
 The code i have in my init() of a controller is:
   $context = $this-_helper-getHelper('ContextSwitch');
   $context-addActionContext('read', 'json');
   $context-initContext();
 
 If my complete runtime invokes only one action (no actionStack used) and
 if I don't call $this-render()  (to render some other script) it works
 just as it should. View is off, layout is off, only view in JSON  fromat
 is sent.
 
 However this stops working when:
 - your action works in a way that it chooses what view script you will
 render for your action accessed in normal way - it requires
 nameOfViewScript.json.phtml
 
 - when you're calling more actions in one runtime (use of actionStack for
 example) - it stops because it didn't find sidebar.json.phtml
 
 
 I think that when you use context for JSON reply it should clear ALL
 attempts of rendering views (unless you define it otherwise) .
 
 Maybe I don't see this right and i didn't choose the right way, maybe it
 isn't a bug, maybe it's wanted feature ;). I don't know but I'd like to
 have this working without need to create *.json.phtml for quite many
 views.
 
 What you think?
 
 
 

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



[fw-general] contextSwitch AjaxContent

2008-08-07 Thread agatone

Hi,

I'm trying to use contextSwitch (or AjaxSwitch) as i want for some action to
be accessible in JSON format.

The code i have in my init() of a controller is:
  $context = $this-_helper-getHelper('ContextSwitch');
  $context-addActionContext('read', 'json');
  $ajaxContext-initContext();

If my complete runtime invokes only one action (no actionStack used) and if
I don't call $this-render()  (to render some other script) it works just as
it should. View is off, layout is off, only view in JSON  fromat is sent.

However this stops working when:
- your action works in a way that it chooses what view script you will
render for your action accessed in normal way - it requires
nameOfViewScript.json.phtml

- when you're calling more actions in one runtime (use of actionStack for
example) - it stops because it didn't find sidebar.json.phtml


I think that when you use context for JSON reply it should clear ALL
attempts of rendering views (unless you define it otherwise) .

Maybe I don't see this right and i didn't choose the right way, maybe it
isn't a bug, maybe it's wanted feature ;). I don't know but I'd like to
have this working without need to create *.json.phtml for quite many views.

What you think?



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



Re: [fw-general] Error in Zend Framework 1.6 RC1 ?

2008-08-07 Thread agatone

I just updated from SVN and I see it's still not working - guess not fixed
yet. :)

I don't wanna be annoying or smtin, but ticket 3783 is marked as resolved
(maybe it should be marked that way and this thing needs new ticket - you
decide) and no new replies here so I don't know what's going on with this
bug.
Maybe you don't have time to work on it , didn't get to it yet or smtin like
that - just say what's up with it :)

Anyways, thanks for work you do! :)

regards


Matthew Weier O'Phinney-3 wrote:
 
 -- agatone [EMAIL PROTECTED] wrote
 (on Wednesday, 30 July 2008, 11:40 PM -0700):
 Bug is still there.
 I've attached ZIP on that ticket. Use zip to recreate the bug.
 
 I'll look into it today.
 
 Matthew Weier O'Phinney-3 wrote:
  
  -- Matthew Weier O'Phinney [EMAIL PROTECTED] wrote
  (on Monday, 28 July 2008, 01:37 PM -0400):
  -- Michael Depetrillo [EMAIL PROTECTED] wrote
  (on Monday, 28 July 2008, 10:09 AM -0700):
   The problem has to do with Zend_Loader_PluginLoader trying to use a
  class
   prefix which matches the sub-controller directory I am using.
   
   My directory structure looks like this.
   
   app/www/controllers/Account.php
   app/www/controllers/Account/Ad.php
   app/www/views/scripts
   app/www/views/helpers
   
   When the view file app/www/views/scripts/account/ad.php calls the
  helper
   $this-getNav(), the plugin loader throws this exception.
   
   File BodyNav.php was loaded but class named
 Account_View_Helper_BodyNav
  was not
   found within it.
   
   The class name should be Zend_View_Helper_BodyNav.  It is using the
  prefix from
   my sub-controller directory.   Not sure why, this broke when I
 upgraded
  to the
   latest trunk version.
  
  Ah, okay -- the above gives me the information I need. I'll work on
  getting a fix into trunk in the next 1-2 days.
  
  Should be fixed now; please see 
  
  http://framework.zend.com/issues/browse/ZF-3783
  
  for details.
  
  
  
   Here is part of my bootstrap.
   
  // initialize view
   $view = new Zend_View($config-view-toArray());
   $view-strictVars(); // enables tracking/detection of typos
 and
   misspelled variables in views
   $view-addBasePath($appDir . DIRECTORY_SEPARATOR . 'views');
 //
  shared
   views directory for all modules
  
 $view-doctype(Zend_View_Helper_Doctype::XHTML1_TRANSITIONAL);
  
   $viewRenderer =
  Zend_Controller_Action_HelperBroker::getStaticHelper
   ('viewRenderer');
   $viewRenderer-setViewSuffix('php')-setView($view);
  
   $frontController = Zend_Controller_Front::getInstance(); //
  manages the
   overall workflow
   $frontController-setDefaultModule($moduleName);
   $frontController-returnResponse(true); // return the
 response
  (do not
   echo it to the browser)
   $frontController-setControllerDirectory(array(
   'www'  = $appDir . DIRECTORY_SEPARATOR  . 'www'   .
   DIRECTORY_SEPARATOR . 'controllers',
   'cli'  = $appDir . DIRECTORY_SEPARATOR  . 'cli'   .
   DIRECTORY_SEPARATOR . 'controllers',
   'admin'= $appDir . DIRECTORY_SEPARATOR  . 'admin' .
   DIRECTORY_SEPARATOR . 'controllers',
   'rest' = $appDir . DIRECTORY_SEPARATOR . 'rest' .
   DIRECTORY_SEPARATOR . 'controllers'
   ));
   
   $frontController-dispatch();
   
   On Mon, Jul 28, 2008 at 6:56 AM, Matthew Weier O'Phinney
  [EMAIL PROTECTED]
   wrote:
   
   -- Michael Depetrillo [EMAIL PROTECTED] wrote
   (on Monday, 28 July 2008, 12:10 AM -0700):
Here is the problem.
   
http://www.domain.com/account_ad
   
Calls the method index in class Account_AdController location
  within
controllers/Account/AdController.php
   
Any helpers used in the view file for this method try to
 render
Account_View_Helper_BodyNav instead of
 Zend_View_Helper_BodyNav
  or
   whichever
prefix I set using $view-setBasePath($path, $prefix).
   
   I need details on your bootstrap -- how are you adding
 controller
   directories, how are you setting up your view, what is your
  directory
   layout. I cannot speculate on the issue or attempt to reproduce
 it
  until
   I know these details.
   
   
On Wed, Jul 23, 2008 at 8:48 PM, Matthew Weier O'Phinney 
   [EMAIL PROTECTED]
wrote:
   
-- Endijs Lisovskis [EMAIL PROTECTED] wrote
(on Wednesday, 23 July 2008, 03:25 PM -0700):

 If I just switch Zend Framework 1.5 library files to
 Zend
  Framework
   1.6
RC1
 library files I receive error:

 Fatal error: Uncaught exception
   'Zend_Loader_PluginLoader_Exception' with
 message 'File LoggedInUser.php was loaded but class
 named
 Rn_View_Helper_LoggedInUser was not found within it.' in

  [full_path_removed

Re: [fw-general] Error in Zend Framework 1.6 RC1 ?

2008-07-31 Thread agatone

Bug is still there.
I've attached ZIP on that ticket. Use zip to recreate the bug.


Matthew Weier O'Phinney-3 wrote:
 
 -- Matthew Weier O'Phinney [EMAIL PROTECTED] wrote
 (on Monday, 28 July 2008, 01:37 PM -0400):
 -- Michael Depetrillo [EMAIL PROTECTED] wrote
 (on Monday, 28 July 2008, 10:09 AM -0700):
  The problem has to do with Zend_Loader_PluginLoader trying to use a
 class
  prefix which matches the sub-controller directory I am using.
  
  My directory structure looks like this.
  
  app/www/controllers/Account.php
  app/www/controllers/Account/Ad.php
  app/www/views/scripts
  app/www/views/helpers
  
  When the view file app/www/views/scripts/account/ad.php calls the
 helper
  $this-getNav(), the plugin loader throws this exception.
  
  File BodyNav.php was loaded but class named Account_View_Helper_BodyNav
 was not
  found within it.
  
  The class name should be Zend_View_Helper_BodyNav.  It is using the
 prefix from
  my sub-controller directory.   Not sure why, this broke when I upgraded
 to the
  latest trunk version.
 
 Ah, okay -- the above gives me the information I need. I'll work on
 getting a fix into trunk in the next 1-2 days.
 
 Should be fixed now; please see 
 
 http://framework.zend.com/issues/browse/ZF-3783
 
 for details.
 
 
 
  Here is part of my bootstrap.
  
 // initialize view
  $view = new Zend_View($config-view-toArray());
  $view-strictVars(); // enables tracking/detection of typos and
  misspelled variables in views
  $view-addBasePath($appDir . DIRECTORY_SEPARATOR . 'views'); //
 shared
  views directory for all modules
  $view-doctype(Zend_View_Helper_Doctype::XHTML1_TRANSITIONAL);
 
  $viewRenderer =
 Zend_Controller_Action_HelperBroker::getStaticHelper
  ('viewRenderer');
  $viewRenderer-setViewSuffix('php')-setView($view);
 
  $frontController = Zend_Controller_Front::getInstance(); //
 manages the
  overall workflow
  $frontController-setDefaultModule($moduleName);
  $frontController-returnResponse(true); // return the response
 (do not
  echo it to the browser)
  $frontController-setControllerDirectory(array(
  'www'  = $appDir . DIRECTORY_SEPARATOR  . 'www'   .
  DIRECTORY_SEPARATOR . 'controllers',
  'cli'  = $appDir . DIRECTORY_SEPARATOR  . 'cli'   .
  DIRECTORY_SEPARATOR . 'controllers',
  'admin'= $appDir . DIRECTORY_SEPARATOR  . 'admin' .
  DIRECTORY_SEPARATOR . 'controllers',
  'rest' = $appDir . DIRECTORY_SEPARATOR . 'rest' .
  DIRECTORY_SEPARATOR . 'controllers'
  ));
  
  $frontController-dispatch();
  
  On Mon, Jul 28, 2008 at 6:56 AM, Matthew Weier O'Phinney
 [EMAIL PROTECTED]
  wrote:
  
  -- Michael Depetrillo [EMAIL PROTECTED] wrote
  (on Monday, 28 July 2008, 12:10 AM -0700):
   Here is the problem.
  
   http://www.domain.com/account_ad
  
   Calls the method index in class Account_AdController location
 within
   controllers/Account/AdController.php
  
   Any helpers used in the view file for this method try to render
   Account_View_Helper_BodyNav instead of Zend_View_Helper_BodyNav
 or
  whichever
   prefix I set using $view-setBasePath($path, $prefix).
  
  I need details on your bootstrap -- how are you adding controller
  directories, how are you setting up your view, what is your
 directory
  layout. I cannot speculate on the issue or attempt to reproduce it
 until
  I know these details.
  
  
   On Wed, Jul 23, 2008 at 8:48 PM, Matthew Weier O'Phinney 
  [EMAIL PROTECTED]
   wrote:
  
   -- Endijs Lisovskis [EMAIL PROTECTED] wrote
   (on Wednesday, 23 July 2008, 03:25 PM -0700):
   
If I just switch Zend Framework 1.5 library files to Zend
 Framework
  1.6
   RC1
library files I receive error:
   
Fatal error: Uncaught exception
  'Zend_Loader_PluginLoader_Exception' with
message 'File LoggedInUser.php was loaded but class named
Rn_View_Helper_LoggedInUser was not found within it.' in
   
 [full_path_removed]/library/Zend/Loader/PluginLoader.php:351 Stack
  trace:
   #0
[full_path_removed]/library/Zend/View/Abstract.php(1114):
Zend_Loader_PluginLoader-load('LoggedInUser') #1
[full_path_removed]/library/Zend/View/Abstract.php(545):
Zend_View_Abstract-_getPlugin('helper', 'loggedInUser') #2
[full_path_removed]/library/Zend/View/Abstract.php(312):
Zend_View_Abstract-getHelper('loggedInUser') #3 [internal
  function]:
Zend_View_Abstract-__call('loggedInUser', Array) #4
   
 [full_path_removed]/application/views/layouts/index.phtml(33):
Zend_View-loggedInUser() #5
 [full_path_removed]/library/Zend/V in

Re: [fw-general] Error in Zend Framework 1.6 RC1 ?

2008-07-29 Thread agatone

No, It doesn't solve it for me.

I use controller plugin to set up my view code in plugin is :

public function dispatchLoopStartup(Zend_Controller_Request_Abstract
$request)
{
  $viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');

  $viewRenderer-setViewBasePathSpec('../application/views');
 
$viewRenderer-setViewScriptPathSpec(':module/:controller/:action.:suffix');

  $viewRenderer-setView(new Zend_View());
  $viewRenderer-view-addHelperPath('../application/views/helpers',
'Dhi_View_Helper');
  $viewRenderer-view-strictVars(false);
}
-

My helper class:
class Dhi_View_Helper_ActionUri
{

public function actionUri($base, $replacement)
{

$returnString = str_replace(array_keys($replacement),
array_values($replacement), $base);

$returnString = preg_replace('/%[^%]{0,}%/i', 'NULL',
$returnString);

return $returnString;
}

}

When I want to use that helper inside a view script that is used in Admin
module, any controller and any action i get Exception: File ActionUri.php
was loaded but class named Admin_View_Helper_ActionUri was not found within
it.

So File was loaded, but again it searched module based helper.

I was trying to see what is going on inside ZF code and i saw 3 class names
it is looking for. Common Zend Helper class, class prefixed with what I
added with addHelperPath() and this Module based class (the one that makes
thing throw exception)

Helpers were written according to :
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.custom




Matthew Weier O'Phinney-3 wrote:
 
 -- Matthew Weier O'Phinney [EMAIL PROTECTED] wrote
 (on Monday, 28 July 2008, 01:37 PM -0400):
 Should be fixed now; please see 
 
 http://framework.zend.com/issues/browse/ZF-3783
 
 for details.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-in-Zend-Framework-1.6-RC1---tp18621418p18706990.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Error in Zend Framework 1.6 RC1 ?

2008-07-28 Thread agatone

So, anything on this ?


agatone wrote:
 
 I have same problem and I'll try to explain it a bit more
 
 Exception: File ActionUri.php was loaded but class named
 Admin_View_Helper_ActionUri was not found within it.
 
 I setup my view in controller plugin in dispatchLoopStartup() and I add
 Helper path and prefix of my class -
 $viewRenderer-view-addHelperPath('../application/views/helpers',
 'Dhi_View_Helper');
 
 However when I use it in any module it will load right file but it will
 try to look for class prefix : $moduleName . 'View_Helper. So in a way
 all my global view helpers are useless in modules , unless I extend each
 of them with module named class form (like Admin_View_Helper_ActionUri).
 
 I was checking what classes did zf loader look for and there were three
 class names. One was default ZF naming, second was the one I added with
 addHelperPath() and the thrid was this MODULE based. It starts looking
 first for module named class and since it loaded right file but could find
 the class it stopped there.
 
 Hope this helps.
 
 
 
 
 
 Matthew Weier O'Phinney-3 wrote:
 
 -- Endijs Lisovskis [EMAIL PROTECTED] wrote
 (on Wednesday, 23 July 2008, 03:25 PM -0700):
 First off, in 1.6, we refactored the code in Zend_View to utilize the
 PluginLoader -- no reason to have code duplication. :)
 
 Most likely, what's happening is that you've got an invalid helper
 prefix registered; why it was not throwing an error before is the new
 question.
 
 Several qustions:
 
  * How are you setting up your views?
  * How are you adding the Rn_View_Helper prefix to the view object?
* Is 'Rn' a module? or a private library namespace?
  * Can you confirm that the file LoggedInuser.php exists on the helper
path? If so, what class is in it?
 
 Answer those questions, and I may have a better idea of how to fix the
 issue.
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-in-Zend-Framework-1.6-RC1---tp18621418p18684720.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Error in Zend Framework 1.6 RC1 ?

2008-07-24 Thread agatone

I have same problem and I'll try to explain it a bit more

Exception: File ActionUri.php was loaded but class named
Admin_View_Helper_ActionUri was not found within it.

I setup my view in controller plugin in dispatchLoopStartup() and I add
Helper path and prefix of my class -
$viewRenderer-view-addHelperPath('../application/views/helpers',
'Dhi_View_Helper');

However when I use it in any module it will load right file but it will try
to look for class prefix : $moduleName . 'View_Helper. So in a way all my
global view helpers are useless in modules , unless I extend each of them
with module named class form (like Admin_View_Helper_ActionUri).

I was checking what classes did zf loader look for and there were three
class names. One was default ZF naming, second was the one I added with
addHelperPath() and the thrid was this MODULE based. It starts looking first
for module named class and since it loaded right file but could find the
class it stopped there.

Hope this helps.





Matthew Weier O'Phinney-3 wrote:
 
 -- Endijs Lisovskis [EMAIL PROTECTED] wrote
 (on Wednesday, 23 July 2008, 03:25 PM -0700):
 First off, in 1.6, we refactored the code in Zend_View to utilize the
 PluginLoader -- no reason to have code duplication. :)
 
 Most likely, what's happening is that you've got an invalid helper
 prefix registered; why it was not throwing an error before is the new
 question.
 
 Several qustions:
 
  * How are you setting up your views?
  * How are you adding the Rn_View_Helper prefix to the view object?
* Is 'Rn' a module? or a private library namespace?
  * Can you confirm that the file LoggedInuser.php exists on the helper
path? If so, what class is in it?
 
 Answer those questions, and I may have a better idea of how to fix the
 issue.
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-in-Zend-Framework-1.6-RC1---tp18621418p18627894.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] View, template fragments/partials

2008-02-27 Thread agatone

Hello,

I'm trying to code a site completely on ZF, however with all things that ZF
includes I lose lots of time around MVC part - especially View.
At the moment I got stuck with Template fragments or partials. Trying to do
it in the way of best practice I only got more lost and frustrated so I had
to turn here for help :)

I have main page or Home page. Sure this page is made by use of Layout that
includes default.phtml as content. On the main page I'd have 10 last news,
10 last comments, 10 last posts etc. Since 10 last thing would be quite
reused over the site it would have to be fragment - for each of 10 one
fragment (posts, comments, news ...).
Now I don't know exactly what's the best way to do it, but my wish would be:

1 . to have separate HTML fragment combining it with any data filling
fragment
2. to have packed combined HTML fragment and data filling fragment into
something that can be reused through templates.

How would that done ?
-- 
View this message in context: 
http://www.nabble.com/View%2C-template-fragments-partials-tp15714051s16154p15714051.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Subfolders in controller folders

2007-12-06 Thread agatone

Hello,

I have a question about controller folder depth. Lets say i have module
admin and the folder structure would be something like this:
admin
-controllers
--IndexController.php (class Admin_IndexController extends
Zend_Controller_Action)
-models
-views

By that structure i would have URL like
http://www.exmpl.com/admin/index/index
Admin being module name, index being controller and index (2) being action.

But i wish to keep my files a bit more organized, in more folders, structure
like :
admin
-controllers
--news
---IndexController.php (??? class Admin_News_IndexController extends
Zend_Controller_Action ???)
-views
-models

So this structure's url would be http://www.exmpl.com/admin/news/index/index
All fine if it would work, but looks like it doesn't allow subfolders of a
module. It takes admin as module, news as controller file (not what i
wanted) , and index as action. I'd like to keep Admin as module but NEWS to
be just a part of invoking path - i hoped that would be achived by defintion
class Admin_News_IndexController extends Zend_Controller_Action
Am I missing something?
Have to write my own router?

Anyone with solution or anyone who can confirm this is not possible - that i
got lost, please reply

Ty
-- 
View this message in context: 
http://www.nabble.com/Subfolders-in-controller-folders-tf4957417s16154.html#a14196977
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Controller called inside controller for header/footer/menu purposes

2007-08-23 Thread agatone

Since I wanna have header, footer, menu includes etc. and I notice quite few
problems and posts around it.
I found that view script can be included nicely inside other view script
(can say news) with ?php echo $this-render('index/header.phtml') ?

This is quite what i need(not completly), because i can also assign some
variables that are in header.phtml directly from current running action -
listAction.

I made also controller _Include_HeaderController with one action Index which
should assign all that common variables inside header.phtml (if user is
logged - his name, date etc.)

But now i don't know how to run that header controller action inside my news
action so it would normaly assign view variables.

Maybe it's wrong approach - but what i wanna achive is to somehow run
certain VIEW script with certain controller action.
-- 
View this message in context: 
http://www.nabble.com/Controller-called-inside-controller-for-header-footer-menu-purposes-tf4318722s16154.html#a12297598
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Controller called inside controller for header/footer/menu purposes

2007-08-23 Thread agatone

 Maybe it's wrong approach - but what i wanna achive is to somehow run
 certain VIEW script with certain controller action. 
With this part I meant I had in mind to use same Controller-Action on few
different templates (like if I have different headers/footers)

Thank you, I'll give it a test in practice. 



Matthew Weier O'Phinney-3 wrote:
 
 -- agatone [EMAIL PROTECTED] wrote
 (on Thursday, 23 August 2007, 09:58 AM -0700):
 Since I wanna have header, footer, menu includes etc. and I notice quite
 few
 problems and posts around it.
 I found that view script can be included nicely inside other view script
 (can say news) with ?php echo $this-render('index/header.phtml') ?
 
 This is quite what i need(not completly), because i can also assign some
 variables that are in header.phtml directly from current running action -
 listAction.
 
 I made also controller _Include_HeaderController with one action Index
 which
 should assign all that common variables inside header.phtml (if user is
 logged - his name, date etc.)
 
 But now i don't know how to run that header controller action inside my
 news
 action so it would normaly assign view variables.
 
 Don't do this. Use an action helper or a preDispatch() plugin instead to
 do the injection. For instance, you could have an action helper like
 this one:
 
 class My_Helper_Header extends Zend_Controller_Action_Helper_Abstract
 {
 public function preDispatch()
 {
 $this-direct();
 }
 
 public function direct()
 {
 $view =
 Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')-view;
 $view-header_meta = '...';
 $view-header_css  = '...';
 // etc.
 }
 }
 
 Then, in your bootstrap:
 
 Zend_Controller_Action_HelperBroker::addHelper(new
 My_Helper_Header());
 
 The point being, this will do it automatically for you, and doesn't
 require dispatching another controller action.
 
 Maybe it's wrong approach - but what i wanna achive is to somehow run
 certain VIEW script with certain controller action.
 
 That can be done already; the ViewRenderer, which is on by default,
 automatically renders the view script controller/action.phtml.
 
 BTW, what you're trying to do will be addressed for 1.1.0 with the
 addition of placeholders and layout support.
 
 -- 
 Matthew Weier O'Phinney
 PHP Developer| [EMAIL PROTECTED]
 Zend - The PHP Company   | http://www.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Controller-called-inside-controller-for-header-footer-menu-purposes-tf4318722s16154.html#a12299261
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Db (Table-Row)

2007-07-30 Thread agatone

Fetching realted row should be something like this (if i'm not wrong)
?php
$bugsTable = new Bugs();
$bugsRowset= $bugsTable-fetchAll();
foreach ($bufRowset as $bug1) {
  $reporter  = $bug1-findParentAccounts();
}
?

My question is: Is there already somekind of function where you can pass
what parents are to be fetched or I'm on my own here?
-- 
View this message in context: 
http://www.nabble.com/Zend_Db-%28Table-Row%29-tf4179879s16154.html#a11886141
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Db (Table-Row)

2007-07-30 Thread agatone

I'm sorry ... I'll try to explain it a bit better.

Let's say we have table NEWS with fields  id, title, content, rel_author_id,
rel_category_id.

So fetching all news would look something like this:

?php
$news =  new News();
$newsRowset = $news-fetchAll();
?

Now every news has author, who's name I wanna output too. Solution would be
to call method findParentRow('Users') inside of template's foreach (for
every row - news) or to go thru all rows in controller code and get it
there.

What I was thinking is there something to tell what parents (plural is used
cuz news has parent of rel_author_id and rel_category_id) should be fetched. 
For example (I know it's not existing) something like:
?php
$news = News()
$news-autoFetchParents = array('Users', 'Categories');
$newsRowset = $news-fetchAll();
?
I guess there would be a problem when you'd have some relation inside user
table and you would also need that data at outputing news.
Maybe that would could be solved with MD array .:)
array('Users' = array('Roles'), 'Categories');
and more complex:
array('Users' = array('Roles' = array('subsubRole')), 'Categories');

Sorry ... late hour :)
-- 
View this message in context: 
http://www.nabble.com/Zend_Db-%28Table-Row%29-tf4179879s16154.html#a11900923
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Router, Controller Front, Dispatcher

2007-06-27 Thread agatone

I'm sorry but I had to make this post, cuz I don't know what to read anymore
and i'm getting more and more lost.

Problem:
Let's say I have application at http://exmpl.com/.

Now this application has several modules:
http://exmpl.com/news/
http://exmpl.com/blog/
http://exmpl.com/gallery/
etc.

What I don't understand how passing params thru URL's work. As I seen it
says default it's something like this

http://exmpl.com/gallery/id/12/user/15/ - (id = 12, user = 15)
http://exmpl.com/blog/cat/12/
http://exmpl.com/blog/id/112/
etc

Problem is I don't want to write router for every possible path with all
param posibilities. Isn't there any general soultuion whith should parse
params in certain format by default? I've seen, by dumping REQUEST object,
it already knows values of controller, action and module - all i'm  missing
is params.



-- 
View this message in context: 
http://www.nabble.com/Router%2C-Controller-Front%2C-Dispatcher-tf3989103s16154.html#a11326855
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Broken code when upgrading from 0.9.2 - 1.0

2007-06-12 Thread agatone

Somehow I don't understand the logic why would you auto-init VIEW for
complete project. Why such change?
What if I have only controller that handles request and redirects and I
don't need VIEW. Sure you could easly say TURN IT OFF, but what's the point
of TURNING ON things not knowing if people will need them at that point...


tfk wrote:
 
 $controller-setParam('noViewRenderer', true);
 

-- 
View this message in context: 
http://www.nabble.com/Broken-code-when-upgrading-from-0.9.2---1.0-tf3854139s16154.html#a11087511
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] multilanguage contents

2007-05-16 Thread agatone

I have a question considering Multilanguage Contents (posts, news etc.
-commonly read from DB). Does ZF provide any help with solutions of
multilanguage support OR all that needs to be done by yourself ?

If that kind of multilang. isn't supported can I get some advices how you
solve that problem ... or there is no as-much-as-possible solution of it?

As far as I understood Zend_translator isn't meant for that ... it's meant
for different langauge translations of static texts like delete or add
etc.
-- 
View this message in context: 
http://www.nabble.com/multilanguage-contents-tf3764347s16154.html#a10640955
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] multilanguage contents

2007-05-16 Thread agatone

No, you got me wrong (at first part of your message) I didn't mean I wanted
to have my news or smtin like that automaticaly translated.
I meant how is multilingual contents dealt with ... If I wanted to have
title of a news in two languages (en  de) naturaly i would have to make two
fields - title_en  title_de.

Well if Translator gets SQL adapter .. then that would actualy be a solution
... but until then ... :)



Thomas Weidner-2 wrote:
 
 Zend_Translate is not able to translate a text into another language
 without 
 any translation source.
 If you are in need of this you should look at google-translation, babylon
 or 
 some other online-translation services.
 
 Actually I think there is no service-adapter avaiable to do 
 online-translations.
 
 Related to Zend_Translate itself...
 A SQL-Adapter is planned but, for now, not released.
 We want to have 1.0 finished until we integrate new adapters.
 But even with this adapter you would not be able to do online 
 translations...
 This would be a new adapter. But I think the quality of
 online-translations 
 would not satisfy your needs ;-)
 
 Greetings
 Thomas
 I18N Team Leader
 
 
 - Original Message - 
 From: agatone [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Wednesday, May 16, 2007 2:39 PM
 Subject: [fw-general] multilanguage contents
 
 

 I have a question considering Multilanguage Contents (posts, news etc.
 -commonly read from DB). Does ZF provide any help with solutions of
 multilanguage support OR all that needs to be done by yourself ?

 If that kind of multilang. isn't supported can I get some advices how you
 solve that problem ... or there is no as-much-as-possible solution of 
 it?

 As far as I understood Zend_translator isn't meant for that ... it's
 meant
 for different langauge translations of static texts like delete or
 add
 etc.
 -- 
 View this message in context: 
 http://www.nabble.com/multilanguage-contents-tf3764347s16154.html#a10640955
 Sent from the Zend Framework mailing list archive at Nabble.com. 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/multilanguage-contents-tf3764347s16154.html#a10641296
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Action files

2007-04-20 Thread agatone

I'm sorry if this was already discussed but i could find any topics about it.
Let's say we have in our controllers folder this action file : 

class IndexController extends Zend_Controller_Action {
  function indexAction() { ... }
  function addAction() { ... }
  function removeAction() { ... }
  function editAction() { ... }
  function deleteAction() { ...}
   etc. ...
}

So at all this actions file could easily have 500+ lines, what is (in my
oponion) very bad.
Wouldn't be easier if actions could be in separate files - more simple
structure ... ?

Any ideas ?

-- 
View this message in context: 
http://www.nabble.com/Action-files-tf3612069s16154.html#a10094063
Sent from the Zend Framework mailing list archive at Nabble.com.