[fw-general] Zend_Service_Amazon problem

2007-05-27 Thread Cristian Bichis

Hello,

I started using Zend_Service_Amazon.

But i got problems into getting any result from query

   require_once 'Zend/Service/Amazon/Query.php';
   $query = new Zend_Service_Amazon_Query("1"); 
//i hided my API KEY

   $query->category('Books')->Keywords('php');
   $this->view->books = $query->search();

result of $query->search() is always null, no resultset or item returned.

--
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zflinks.com | www.zftalk.com



[fw-general] Re: viewRenderer, setNoController

2007-05-27 Thread Superbiji

sorry I mean,

$c=Zend_Controller_Front::getInstance();
$vr=Zend_Controller_Action_HelperBroker::getExistingHelper("viewRenderer");
$vr->setViewSuffix( "php");
$vr->setNoController( true );

I think now framework will search script ":action.php", but it does not


On 28/05/07, Superbiji <[EMAIL PROTECTED]> wrote:

in my bootstrap:

$vr=Zend_Controller_Action_HelperBroker::getExistingHelper("viewRenderer");

// working
$vr->setScriptSuffix( "php");

// not working
$vr->setNoController( true );


framework still try to find view with controller path (:controller/:action.php)
is my bootstrap wrong?

thanks



[fw-general] viewRenderer, setNoController

2007-05-27 Thread Superbiji

in my bootstrap:

$vr=Zend_Controller_Action_HelperBroker::getExistingHelper("viewRenderer");

// working
$vr->setScriptSuffix( "php");

// not working
$vr->setNoController( true );


framework still try to find view with controller path (:controller/:action.php)
is my bootstrap wrong?

thanks


Re: [fw-general] Zend_Server_Reflection

2007-05-27 Thread PotatoBob



Matthew Weier O'Phinney-3 wrote:
> 
> -- PotatoBob <[EMAIL PROTECTED]> wrote
> (on Saturday, 26 May 2007, 07:10 PM -0700):
>> There seems to be a problem that I've found when brought up by someone on
>> #
>> zftalk. It seems that Zend_Server_Reflection has problems with the use of
>> func_get_args() when there is an @param php doc stating extra params.
> 
> This will be difficult to resolve; Zend_Server_Reflection iterates
> through the params in the docblock and then uses PHP's Reflection API to
> determine additional information (default values, whether or not it's
> optional, type hints, etc.); if the Reflection API has no knowledge of
> the param, you'll get errors like this.
> 
> However, I can probably add some logic to check first that the parameter
> is found by Reflection, and if not, mark it as optional.
> 
> Could you log this as an issue in JIRA for me so I can track it better?
> 
> Thanks!
> 
>> Example:
>> /**
>> * Internally redirects one action to another
>> *
>> * @param string $action The new action to be redirected to
>> * @param mixed Any other parameters passed to this method will be passed
>> as
>> * parameters to the new action.
>> * @access public
>> */
>> function setAction($action) {
>> $this->action = $action;
>> $args = func_get_args();
>> unset($args[0]);
>> call_user_func_array(array(&$this, $action), $args);
>> }
>> 
>> Error msg: ( ! ) Fatal error: Call to a member function isOptional() on a
>> non-object in Zend/Server/Reflection/Function/Abstract.php on line 346
> 
> -- 
> Matthew Weier O'Phinney
> PHP Developer| [EMAIL PROTECTED]
> Zend - The PHP Company   | http://www.zend.com/
> 
> 

Unfortunately I don't have a jira account otherwise I would of posted one
already :S

-- 
View this message in context: 
http://www.nabble.com/Zend_Server_Reflection-tf3822461s16154.html#a10827860
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Controller MVC Questions.

2007-05-27 Thread Matthew Weier O'Phinney
-- James Andrews <[EMAIL PROTECTED]> wrote
(on Sunday, 27 May 2007, 08:02 AM -0400):
> I'm reading the manual on MVC and playing around a little to see how  
> it all works, and one thing I am failing to figure out how to do is  
> separation of common items from pages, such as headers, and footers,  
> and side bars.  Is it possible?  If so can someone point me in the  
> right direction, and if it is not why? I would expect that separation  
> like that is so common in sites that it should be.

You're talking about a Two Step View: get the body content (a rendered
view), and inject it into another view (site template, for example).

I use a dispatchLoopShutdown() plugin to do this. The easiest way is to
pull the content from the response object, inject it into a view, and
then set this rendered content as the response body content. As a
simplified example:

view;
$front= Zend_Controller_Front::getInstance();
$response = $front->getResponse();
$body = $response->getBody();

$view->content = $body;
$response->setBody($view->render('site.phtml'));
}
}

You'll likely want to modify it a bit, but hopefully you get the general
idea.

> Also,
> 
> Say I want to have multiple views, working from the same controllers,  
> I see that the "Zend_View_Interface"  has a setScriptPath method, how  
> would you access this prior to displaying so that you can dynamically  
> choose new view scripts but keep the same controllers?

With the view renderer, what I'd do is, in your bootstrap, set a
'sitewide' view script path for view scripts that you want shared across
controllers:

$view = new Zend_View(array('basePath' => '../views'));
Zend_Controller_Action_HelperBroker::addHelper(new 
Zend_Controller_Action_Helper_ViewRenderer($view));

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Zend_Server_Reflection

2007-05-27 Thread Matthew Weier O'Phinney
-- PotatoBob <[EMAIL PROTECTED]> wrote
(on Saturday, 26 May 2007, 07:10 PM -0700):
> There seems to be a problem that I've found when brought up by someone on #
> zftalk. It seems that Zend_Server_Reflection has problems with the use of
> func_get_args() when there is an @param php doc stating extra params.

This will be difficult to resolve; Zend_Server_Reflection iterates
through the params in the docblock and then uses PHP's Reflection API to
determine additional information (default values, whether or not it's
optional, type hints, etc.); if the Reflection API has no knowledge of
the param, you'll get errors like this.

However, I can probably add some logic to check first that the parameter
is found by Reflection, and if not, mark it as optional.

Could you log this as an issue in JIRA for me so I can track it better?

Thanks!

> Example:
> /**
> * Internally redirects one action to another
> *
> * @param string $action The new action to be redirected to
> * @param mixed Any other parameters passed to this method will be passed as
> * parameters to the new action.
> * @access public
> */
> function setAction($action) {
> $this->action = $action;
> $args = func_get_args();
> unset($args[0]);
> call_user_func_array(array(&$this, $action), $args);
> }
> 
> Error msg: ( ! ) Fatal error: Call to a member function isOptional() on a
> non-object in Zend/Server/Reflection/Function/Abstract.php on line 346

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Controller MVC Questions.

2007-05-27 Thread James Andrews
Sweets!  thanks.  This looks like exactly what I need to figure this  
out.


James


On May 27, 2007, at 8:15 AM, Johannes Schill wrote:


This tutorial might help you out:
http://akrabat.com/zend-framework-tutorial/

On 5/27/07, James Andrews <[EMAIL PROTECTED]> wrote:
I'm reading the manual on MVC and playing around a little to see how
it all works, and one thing I am failing to figure out how to do is
separation of common items from pages, such as headers, and footers,
and side bars.  Is it possible?  If so can someone point me in the
right direction, and if it is not why? I would expect that separation
like that is so common in sites that it should be.

Also,

Say I want to have multiple views, working from the same controllers,
I see that the "Zend_View_Interface"  has a setScriptPath method, how
would you access this prior to displaying so that you can dynamically
choose new view scripts but keep the same controllers?

Thanks,
James





[fw-general] Controller MVC Questions.

2007-05-27 Thread James Andrews
I'm reading the manual on MVC and playing around a little to see how  
it all works, and one thing I am failing to figure out how to do is  
separation of common items from pages, such as headers, and footers,  
and side bars.  Is it possible?  If so can someone point me in the  
right direction, and if it is not why? I would expect that separation  
like that is so common in sites that it should be.


Also,

Say I want to have multiple views, working from the same controllers,  
I see that the "Zend_View_Interface"  has a setScriptPath method, how  
would you access this prior to displaying so that you can dynamically  
choose new view scripts but keep the same controllers?


Thanks,
James


RE: [fw-general] Zend_Filter_Input problem

2007-05-27 Thread Jakub Podhorský
Thanks for fix and sorry for my bad english

 

  _  

From: Bill Karwin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 26, 2007 6:59 PM
To: fw-general@lists.zend.com
Subject: RE: [fw-general] Zend_Filter_Input problem

 

Thanks for the issue report Jakub, I have logged it as
http://framework.zend.com/issues/browse/ZF-1437 and I will begin working on
it.

 

Regards,

Bill Karwin

 


  _  


From: Jakub Podhorský [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 26, 2007 3:47 AM
To: fw-general@lists.zend.com
Subject: [fw-general] Zend_Filter_Input problem

Hello,

I've got one problem with Zend_Filter_Input and I don't know how to solve
it. I have:

 

 '',

'email' => '[EMAIL PROTECTED]',

'message' => 'my long message'

);

$filters = array(  '*' => new Zend_Filter_StringTrim(),

'nick' => new Zend_Filter_StripTags()

);

$validators = array('email' => array( new
Zend_Validate_EmailAddress(),

 
Zend_Filter_Input::ALLOW_EMPTY => true

   ),

   'nick' => array(
Zend_Filter_Input::PRESENCE => Zend_Filter_Input::PRESENCE_REQUIRED,

Zend_Filter_Input::ALLOW_EMPTY => false

)

   );

$input = new Zend_Filter_Input($filters, $validators, $data);

if ($input->hasInvalid())

{

$message = $input->getMessages();

}

?>

 

If I have empty string in nick field it can't pass but it doesn't work. I
don't need to make any other validation on that field. 

 

Thanks for every help,

Jakub Podhorský



[fw-general] Automatically registering View variables

2007-05-27 Thread Mathew Byrne
I'm wondering what peoples thoughts are on automatically registering  
view variables and/or using some other method to bridge the gap  
between Action Helper objects and a View object.


With the introduction of the ViewRenderer helper, I starting to more  
and more see the value of Action Helpers. But there are a lot of  
scenarios where I'd like to inject the functionality into the Action  
without having to somehow route the output of such functionality into  
the View.


Take for instance the FlashMessenger helper; if I wanted to  
automatically collect messages and send them to the View object I'd  
have to probably subclass Zend_Controller_Action and override the  
render() function with a method which registers the messages in the  
view. However this wont work with ViewRenderer!


One other option I considered would be somehow incorporating this  
automatic View Variable assigning into the postDispatch method.  
However is there any specified order in which postDispatch will run  
for registered Action Helpers?


Another option again would be to write a View Helper class which  
would somehow interface with the Action Helper and provide view  
access for the output of the Action Helper.


None of these options seems particularly elegant or suitable to me.  
Can anyone suggest a best-practise for automatically registering view  
variables in this fashion? Is there a better way to access these  
variables that perhaps I'm not considering?


Thanks,

--
Mathew Byrne