[fw-general] Links in Zend Form?

2008-10-23 Thread ArticSun

Hi all!

   I'm using Zend_Form for a reservation form. In this form you need to
check a checkbox to state that you agree with the general conditions. Now I
want to add a link to this general conditions, but how do I do this?

When I put a link in the label in front of the checkbox it just echos the
link html in stead of actually making a link. And I can't find a way to add
some HTML element to the form like you add a textfield.

Anyone who can help me out with this?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Links-in-Zend-Form--tp20125588p20125588.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Fwd:

2008-10-23 Thread srikanthreddy mora
-- Forwarded message --
From: srikanthreddy mora <[EMAIL PROTECTED]>
Date: Thu, Oct 23, 2008 at 1:06 PM
Subject: Re:
To: sudarsan rao <[EMAIL PROTECTED]>


hai ra
Emiti messages papav shiridi sai babadi


Are ne mobile no miss aindi ,sudhakar ni adigina ledanadu. ne mobile no mail
cheye leka pote one missed  call evu.
ok na

On Thu, Oct 23, 2008 at 1:02 PM, sudarsan rao <[EMAIL PROTECTED]>wrote:

> hi
>
>


Re: [fw-general] Partial Loop Zebra Stripe

2008-10-23 Thread monk.e.boy



Kamil N wrote:
> 
> 
> There is a view helper 
> http://framework.zend.com/svn/framework/standard/incubator/library/Zend/View/Helper/Cycle.php
> and here is some docu
> http://framework.zend.com/svn/framework/standard/incubator/documentation/manual/en/module_specs/Zend_View-Helpers-Cycle.xml
> 
> 

Thanks for this, sorry I was so long replying, but I'm having a few problems
with this helper.

How do I use it in a partial loop? This is what I am doing:

Controller: get rows from Model
Controller: make cycle object
Controller: attach both to view
View: pass rows to loop partial
Loop Partial: draw a 

But in the partial I have no access to the Cycle and so I can't zebra my
s :-(

plz hlp!!

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/Partial-Loop-Zebra-Stripe-tp19955744p20127369.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Partial Loop Zebra Stripe

2008-10-23 Thread monk.e.boy

Damn, I forgot to post these links that really helped me out:

http://framework.zend.com/wiki/display/ZFPROP/Zend_View_Helper_Cycle+-+Kamil+Nowakowski

http://framework.zend.com/wiki/display/ZFPROP/Home   <-- search this page
for 'cycle'

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/Partial-Loop-Zebra-Stripe-tp19955744p20127394.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Problems submitting a Zend_Form

2008-10-23 Thread scieck

I am guessing here because you posted no code of yours:

if your wrote a Regex validator, check you wrote it the correct way:

$your_element->addValidator('Regex', false, array('/^[a-z]/i'))

not the array above that contains the regular expression, often your error
happens when the regular expression is passed without the array.



Steven Szymczak wrote:
> 
> I've built a simple login form, which displays properly and with no 
> errors.  However, when the form is submitted, the following error is all 
> I get:
> 
> Fatal error: Cannot unset string offsets in 
> /Users/Steven/Sites/wa3gukin.com/library/Zend/Form/Element.php on line
> 1999
> 
> -
> 
> I found that particular line, and it says:
> 
> if (isset($validator['options']['messages'])) {
>  $messages = $validator['options']['messages'];
> (1999)  unset($validator['options']['messages']);
> }
> 
> Echoing $messages shows that it contains only "/".  It seems to me that 
> it's trying to unset an array that's actually a string.  Is this a bug, 
> or have I somehow managed to improperly set an option/variable in the
> form?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-submitting-a-Zend_Form-tp20109449p20129143.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Links in Zend Form?

2008-10-23 Thread EducatedFool

Don't we all have some layout problems with the zend forms? :confused:

So what did I do? I don't know if it's totally correct but I created an
'form' element like text, file, textarea, ... but than a 'div'...

Something like this:

div.php


FormDiv.php
_getInfo($name, $value, $attribs);
extract($info); // name, value, attribs, options, listsep, disable

$endTag = '';

$xhtml = '_htmlAttribs($attribs)
. '>' . $this->view->escape($value)
. $endTag;

return $xhtml;
}
}

You can call it the same way you do: createElement('div',
'test')->setLabel('blabla')->setValue('your hyperlink');

Hopes this helps

-
http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Links-in-Zend-Form--tp20125588p20130490.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Links in Zend Form?

2008-10-23 Thread Mon Zafra
Pass ''escape' => false to the Label decorator

On Thu, Oct 23, 2008 at 3:16 PM, ArticSun <[EMAIL PROTECTED]> wrote:

>
> Hi all!
>
>   I'm using Zend_Form for a reservation form. In this form you need to
> check a checkbox to state that you agree with the general conditions. Now I
> want to add a link to this general conditions, but how do I do this?
>
> When I put a link in the label in front of the checkbox it just echos the
> link html in stead of actually making a link. And I can't find a way to add
> some HTML element to the form like you add a textfield.
>
> Anyone who can help me out with this?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/Links-in-Zend-Form--tp20125588p20125588.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
   -- Mon


Re: [fw-general] Zend_Form Decoration

2008-10-23 Thread nwhiting

That works great! Thank you!


Mon Zafra wrote:
> 
> Try this:
> 
>   array('ViewHelper',
> array(array('inputWrap'=>'HtmlTag'),
>   array('tag' => 'div',
> 'class' => 'something')),
> array(array('labelWrapClose'=>'HtmlTag'),
>   array('tag' => 'div',
> 'closeOnly' => true,
> 'placement' =>
> Zend_Form_Decorator_Abstract::PREPEND)),
> 'Label',
> array(array('labelWrapOpen'=>'HtmlTag'),
>   array('tag' => 'div',
> 'openOnly' => true,
> 'class' => 'something',
> 'placement' =>
> Zend_Form_Decorator_Abstract::PREPEND)),
> array(array('allWrap'=>'HtmlTag'),
>   array('tag' => 'div',
> 'class' => 'something')))
> 
> 
> On Thu, Oct 23, 2008 at 4:23 AM, nwhiting <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hello,
>>
>> I am using the Zend_Form and am Having quite a few problems with the
>> decoration.
>>
>> What I am trying to achieve is get the form to render with the following
>> html output of something like this
>>
>> 
>>   
>>   
>>   
>>   
>>
>>   
>> 
>>
>> And I need to accomplish this for each form element and really cant find
>> a
>> way to accomplish this?
>> --
>> View this message in context:
>> http://www.nabble.com/Zend_Form-Decoration-tp20118548p20118548.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
>-- Mon
> 
> 

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



Re: [fw-general] Zend_Form - Multipage SubForm and isValid

2008-10-23 Thread fozzyuw


Matthew Weier O'Phinney-3 wrote:
> 
> SubForms are namespaced -- so you can do the following:
> 
> $errors = $form->getMessages();
> 
> and look through the keys to that to see which forms threw errors. :)
> 

Yup, I've tried something like this:

-
$valid = $form->isValid($data);

if (!$valid) {

$errors = $form->getErrors();
$Ermsgs = $form->getErrorMessages();
$msgs   = $form->getMessages();

echo "";

print_r($errors);
print_r($Ermsgs);
print_r($msgs);

echo "";

}
-
To try and troubleshoot and understand what I'm getting back.

All I get is the integer "1" for each of those values, which is what's
confusing me.  I would have expected an array of subForm names or something
with each error message.

I wasn't sure what I might be doing or thinking wrong.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Multipage-SubForm-and-isValid-tp20119685p20130843.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Looking for a complete Complete Zend_Paginator example

2008-10-23 Thread ashish.sharma

Nothing seems to be working.

Used the code snippet but when I "print_r()" he paginator then I am not able
to see the total number of records, total pages formed etc.

Also, I m not sure whether use of fetchAll is appropriate or not. What is
the use of fetching all the records? Can't we do something like .. just
fetch the rows to be displayed and the count(*) of the query to get the
total records.

Kindly advice!

Ashish Sharma
TL R&D



411161 wrote:
> 
> I have it working, but I am not sure how to create links for next, last,
> first, previous, numbers, etc.. I am also not sure how to handle links in
> my controller. 
> This is what I have so far."
> 
> controller:
>   public function paginateAction()  {
> 
>   $sql = 'SELECT * FROM runz_miles WHERE empl_no = 31713';
>   $this->view->result = $this->db->fetchAll($sql);
>   $paginator = Zend_Paginator::factory($this->view->result);
>   $paginator->setCurrentPageNumber(15);
>   $this->view->paginator = $paginator;
>   }
> 
> in my view I have:
> 
>  foreach($this->paginator as $key => $row){
> 
>   echo "" .$row['EMPL_NO']
> . "\n";
>   echo "" .$row['PRISM_ORG_CODE'] 
> . "\n";
> }
> ?>
> 
> 
> How do I create the links and I how do I handle the action so that it will
> not try and call the sql again?
> 

-- 
View this message in context: 
http://www.nabble.com/Looking-for-a-complete-Complete-Zend_Paginator-example-tp19731530p20131009.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Problems submitting a Zend_Form

2008-10-23 Thread Steven Szymczak
I probably should have included the code, but I didn't want to make the 
message painfully long.  Anyway, good guess; writing the regex validator 
in the wrong format is exactly what I did.


Cheers,
-- Steven

scieck wrote:

I am guessing here because you posted no code of yours:

if your wrote a Regex validator, check you wrote it the correct way:

$your_element->addValidator('Regex', false, array('/^[a-z]/i'))

not the array above that contains the regular expression, often your error
happens when the regular expression is passed without the array.



Steven Szymczak wrote:
I've built a simple login form, which displays properly and with no 
errors.  However, when the form is submitted, the following error is all 
I get:


Fatal error: Cannot unset string offsets in 
/Users/Steven/Sites/wa3gukin.com/library/Zend/Form/Element.php on line

1999

-

I found that particular line, and it says:

if (isset($validator['options']['messages'])) {
 $messages = $validator['options']['messages'];
(1999)  unset($validator['options']['messages']);
}

Echoing $messages shows that it contains only "/".  It seems to me that 
it's trying to unset an array that's actually a string.  Is this a bug, 
or have I somehow managed to improperly set an option/variable in the

form?






Re: [fw-general] Zend_Form - Multipage SubForm and isValid

2008-10-23 Thread fozzyuw

Actually,

as a follow up, it seems that my output method is what's misleading me. 
I've changed some things up to display different and I am seeing the error
messages returning an array with the subForm title being listed (as I would
have expected it to).

So, it seems there's something else going on that I'm not catching properly. 
Like, where this number "1" is coming from.  But, regardless,
$form->getMessages() is returning an array, it just wasn't being output
properly.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Multipage-SubForm-and-isValid-tp20119685p20131560.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form - Multipage SubForm and isValid

2008-10-23 Thread fozzyuw

Embarrassingly enough,

The "1" is coming from my use of print_r() to do debug output.  It returns a
"1" as the function, while sending whatever was sent as it's parameter to
the output buffer.  Where, in my first use, I was just sending it to the
FlashMessange, so I wasn't even picking up the output buffer.

So, it had nothing to do with a problem I was having with Zend_Form but just
using PHP wrong. %-|
-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Multipage-SubForm-and-isValid-tp20119685p20131957.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form Decoration

2008-10-23 Thread nwhiting

Another quick question

I have gotten everything to render allmost exactly the way i need it to be
using the following

$this->setElementDecorators(array(
'ViewHelper',
array(
  array(
'inputWrap' => 'HtmlTag',
),
  array('tag' => 'div',
'class' => 'formDataRight',
),
  'placement' => 'append'
  ),
'Label',
array(
  array('labelWrap' => 'HtmlTag'),
  array('tag' => 'div',
'class' => 'formDataLeft',
'openOnly' => true,
'placement' => 'append'
)),
array(
  array(
'labelWrapClose'=>'HtmlTag'
),
  array('tag' => 'div',
'closeOnly' => true,
'placement' => Zend_Form_Decorator_Abstract::APPEND
)
  ),
array(array('allWrap' => 'HtmlTag'),
  array('tag' => 'div',
'class' => 'formEntryLine'),
  )
));

the only problem that I have is correctly position the label inside of the
formEntryLeft div tag

the output result from that decorator is




 First name



   

 
 


i bolded the text and italics what it is supposed to be contained within.

I know this is the positioning but I cannot figure out how to position the
label
-- 
View this message in context: 
http://www.nabble.com/Zend_Form-Decoration-tp20118548p20132123.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form Decoration

2008-10-23 Thread Mon Zafra
First, put the labelWrap before the Label. Then change the placement of
label to 'append'.

... ,
array(array('labelWrap' => 'HtmlTag'), array(...)),
array('Label', array('placement' => 'append')),
...

On Thu, Oct 23, 2008 at 10:25 PM, nwhiting <[EMAIL PROTECTED]> wrote:

>
> Another quick question
>
> I have gotten everything to render allmost exactly the way i need it to be
> using the following
>
> $this->setElementDecorators(array(
> 'ViewHelper',
>array(
>  array(
>'inputWrap' => 'HtmlTag',
>),
>  array('tag' => 'div',
> 'class' => 'formDataRight',
>),
>  'placement' => 'append'
>  ),
>'Label',
>array(
>  array('labelWrap' => 'HtmlTag'),
>  array('tag' => 'div',
>'class' => 'formDataLeft',
>'openOnly' => true,
>'placement' => 'append'
> )),
>array(
>  array(
>'labelWrapClose'=>'HtmlTag'
>),
>  array('tag' => 'div',
>'closeOnly' => true,
> 'placement' => Zend_Form_Decorator_Abstract::APPEND
>)
>   ),
>array(array('allWrap' => 'HtmlTag'),
>  array('tag' => 'div',
> 'class' => 'formEntryLine'),
>  )
>));
>
> the only problem that I have is correctly position the label inside of the
> formEntryLeft div tag
>
> the output result from that decorator is
>
>  class="form_input" autocomplete="off" action="" method="post">
> 
>
> First name
>
> value="">
>
>   
>
>  
>  
>
>
> i bolded the text and italics what it is supposed to be contained within.
>
> I know this is the positioning but I cannot figure out how to position the
> label
> --
> View this message in context:
> http://www.nabble.com/Zend_Form-Decoration-tp20118548p20132123.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
   -- Mon


Re: [fw-general] Zend_Form Decoration

2008-10-23 Thread nwhiting

Yes thnx for the help I just got it lol :)


Mon Zafra wrote:
> 
> First, put the labelWrap before the Label. Then change the placement of
> label to 'append'.
> 
> ... ,
> array(array('labelWrap' => 'HtmlTag'), array(...)),
> array('Label', array('placement' => 'append')),
> ...
> 
> On Thu, Oct 23, 2008 at 10:25 PM, nwhiting <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Another quick question
>>
>> I have gotten everything to render allmost exactly the way i need it to
>> be
>> using the following
>>
>> $this->setElementDecorators(array(
>> 'ViewHelper',
>>array(
>>  array(
>>'inputWrap' => 'HtmlTag',
>>),
>>  array('tag' => 'div',
>> 'class' => 'formDataRight',
>>),
>>  'placement' => 'append'
>>  ),
>>'Label',
>>array(
>>  array('labelWrap' => 'HtmlTag'),
>>  array('tag' => 'div',
>>'class' => 'formDataLeft',
>>'openOnly' => true,
>>'placement' => 'append'
>> )),
>>array(
>>  array(
>>'labelWrapClose'=>'HtmlTag'
>>),
>>  array('tag' => 'div',
>>'closeOnly' => true,
>> 'placement' => Zend_Form_Decorator_Abstract::APPEND
>>)
>>   ),
>>array(array('allWrap' => 'HtmlTag'),
>>  array('tag' => 'div',
>> 'class' => 'formEntryLine'),
>>  )
>>));
>>
>> the only problem that I have is correctly position the label inside of
>> the
>> formEntryLeft div tag
>>
>> the output result from that decorator is
>>
>> > class="form_input" autocomplete="off" action="" method="post">
>> 
>>
>> First name
>>
>>> value="">
>>
>>   
>>
>>  
>>  
>>
>>
>> i bolded the text and italics what it is supposed to be contained within.
>>
>> I know this is the positioning but I cannot figure out how to position
>> the
>> label
>> --
>> View this message in context:
>> http://www.nabble.com/Zend_Form-Decoration-tp20118548p20132123.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
>-- Mon
> 
> 

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



[fw-general] Outputting an image

2008-10-23 Thread Michael Crumm
Hello all,
I seem to be unable to output an image to the browser via a zf controller
action.  relevent code follows.

public function viewAction()
{
$this->_helper->layout->disableLayout();
  $this->_helper->ViewRenderer->setNoRender();
  if (!$id = $this->_getParam('id', false)) {
  return $this->_helper->redirector('index');
}

$model = $this->getModel();
  $image = $model->get($id);

$this->_response->setHeader('Content-Type', 'image/jpeg', true);
  echo $image['data'];
}

As you can see, when the action is called (with a valid id parameter), i
just want the browser to spit out the image.  Instead, i'm getting no output
at all.

I have using readfile() and pointing to a absolute filesystem path as well,
also with no luck.

The data appears to be downloading - firebug shows the actual image sizes
being downloaded


Does anyone have any thoughts?

Michael Crumm


Re: [fw-general] Looking for a complete Complete Zend_Paginator example

2008-10-23 Thread Matthew Ratzloff
print_r() will not work.
You should not fetch the rows.  You should pass the Select object directly
to the Paginator's factory() method.  It only selects the rows necessary.

-Matt

On Thu, Oct 23, 2008 at 6:31 AM, ashish.sharma <
[EMAIL PROTECTED]> wrote:

>
> Nothing seems to be working.
>
> Used the code snippet but when I "print_r()" he paginator then I am not
> able
> to see the total number of records, total pages formed etc.
>
> Also, I m not sure whether use of fetchAll is appropriate or not. What is
> the use of fetching all the records? Can't we do something like .. just
> fetch the rows to be displayed and the count(*) of the query to get the
> total records.
>
> Kindly advice!
>
> Ashish Sharma
> TL R&D
>
>
>
> 411161 wrote:
> >
> > I have it working, but I am not sure how to create links for next, last,
> > first, previous, numbers, etc.. I am also not sure how to handle links in
> > my controller.
> > This is what I have so far."
> >
> > controller:
> >   public function paginateAction()  {
> >
> >   $sql = 'SELECT * FROM runz_miles WHERE empl_no = 31713';
> >   $this->view->result = $this->db->fetchAll($sql);
> >   $paginator = Zend_Paginator::factory($this->view->result);
> >   $paginator->setCurrentPageNumber(15);
> >   $this->view->paginator = $paginator;
> >   }
> >
> > in my view I have:
> > 
> >  > foreach($this->paginator as $key => $row){
> >
> >   echo "" .$row['EMPL_NO']
>  . "\n";
> >   echo "" .$row['PRISM_ORG_CODE']
> . "\n";
> > }
> > ?>
> > 
> >
> > How do I create the links and I how do I handle the action so that it
> will
> > not try and call the sql again?
> >
>
> --
> View this message in context:
> http://www.nabble.com/Looking-for-a-complete-Complete-Zend_Paginator-example-tp19731530p20131009.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] Framework setup for local dev. and shared hosting.

2008-10-23 Thread Giovanni A. D.
On Thu, Oct 23, 2008 at 7:51 AM, Rob Allen <[EMAIL PROTECTED]> wrote:

> You can see an example of this working in the tutorial at
> http://akrabat.com/zend-framework-tutorial as I wrote it with the assumption
> that you wouldn't want to go to the hassle of setting up a new vhost just to
> test out ZF. Just don't deploy to a live server like this :)

Thanks Rob and Chris!
And Rob, thanks for the tutorial too! Looks very interesting and useful.

> I have multiple copies of ZF - one per project in the lib directory as some
> projects may be on 1.0 and others one 1.5 and still others on 1.6.

I see.. as I said for now I'm new so I'm just usting 1.6 and probably
I'll do some test with the 1.7 development snapshots builds just to
try out the dojo visual editor ;)
btw.. is it usually hard to upgrade something you wrote for versione
1.5 so that it could use version 1.6 and so on? what are your
experiences and are there any "guidelines" / tips to follow in order
to keep your code easily upgradable to a newer version of the library?
or in some case it would just require too much effort so that is more
convenient to rewrite everything from scratch?

thanks.

bye,
Giovanni.


Re: Re: [fw-general] Framework setup for local dev. and shared hosting.

2008-10-23 Thread Chris Martin


Rob Allen-3 wrote:
> 
> 
> Out of interest, do you have a .htaccess file in your project root  
> folder to redirect all traffic to the ./public?
> 
> 

My index.php/.htaccess setup is modified a bit...
I have an .htaccess file in my project root folder that rewrites all
requests to a index.php which is also in my project root folder. For any
images/css/js/etc. that I want to access from my project/public/ folder, I
have a rewrite filter to allow them through based on file extension:

   RewriteEngine on
   RewriteRule !\.(js|ico|gif|jpg|png|css|mpg|avi|swf|html|htm)$ index.php

Files within project/public/ are accessed via: 
 http://host/project/public/css/styles.css

Controller actions are accessed via:
 http://host/project/module/controller/action

My structure looks like:

webroot/
   project1/   (accessed via http://host/project1)
  .htaccess (Rewrite to ./index.php)
  index.php (hooks to app/Bootstrap.php)

  app/
 .htaccess (deny from all)
 Bootstrap.php
 config/
 layouts/
 modules/
 tests/
 tmp/
 tools/

  public/
 css/
 files/
 img/
 js/
 
   project2/...
   project3/...

I did this so I wouldn't have to see
http://host/project/public/module/controller/action... so it's mainly
personal preference. There are pros and cons to either approach. It is great
that apache and ZF are flexible like this.

And again to note, this is all because my host provider is limited - It is
more secure to use virtual directories pointing to your /public and keeping
your code out of the webroot.

Cheers!
-- 
View this message in context: 
http://www.nabble.com/Framework-setup-for-local-dev.-and-shared-hosting.-tp20108467p20137349.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Translation status bulgarina should be with capital letter!!!!!

2008-10-23 Thread Julian Davchev
http://framework.zend.com/manual/status
Please whoever responsible fix this. All languages are with capital
letter only Bulgarian with small.
български should be Български


[fw-general] Action helper and Layout

2008-10-23 Thread Marko Korhonen

Hi,

I make calls to another actions with action view helper.
$this->action(action, controller, module, params_array)

For example, I want to call some module/controller/action for the content of
the left pane.

I also pass the param "layout" in action call.

BUT, when I expect the rendered action call rendered with layout I defined
as param,
my main view changes it's layout.

Is this bug or expected behaviour and how should I resolve this?

kr, Marko
-- 
View this message in context: 
http://www.nabble.com/Action-helper-and-Layout-tp20138119p20138119.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Action helper and Layout

2008-10-23 Thread Jani Hartikainen

The actions called with the action helper are all called
inside the same request process as your main action, so
you can't use Zend_Layout for giving the sub-actions different
layouts.

Perhaps you could render the action-specific layouts inside
the layout itself, using $this->render($layout), and calling
the action helper inside that? Not 100% sure if that'll work
though. Another way could be to use the layout parameter to
simply switch to a different viewscript inside the sub action
instead of changing the layout.

--
Jani Hartikainen
http://codeutopia.net/

On Thu, 23 Oct 2008 22:38:04 +0300, Marko Korhonen  
<[EMAIL PROTECTED]> wrote:



Hi,

I make calls to another actions with action view helper.
$this->action(action, controller, module, params_array)

For example, I want to call some module/controller/action for the  
content of

the left pane.

I also pass the param "layout" in action call.

BUT, when I expect the rendered action call rendered with layout I  
defined

as param,
my main view changes it's layout.

Is this bug or expected behaviour and how should I resolve this?

kr, Marko


Re: [fw-general] ZF performances / profiling the culprit

2008-10-23 Thread Bruno Friedmann
Follow at the end

Matthew Weier O'Phinney wrote:
> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> (on Tuesday, 21 October 2008, 09:45 PM +0200):
>> Matthew Weier O'Phinney wrote:
>>> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
>>> (on Tuesday, 21 October 2008, 06:56 AM +0200):
 Matthew Weier O'Phinney wrote:
> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> (on Monday, 20 October 2008, 07:00 AM +0200):
>> Matthew Weier O'Phinney wrote:
>>> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
>>> (on Sunday, 19 October 2008, 07:30 PM +0200):
 With the help of ZendStudio, I'm trying to understand why on one
 application I've got 25/30 req/s and on the second one I've only a
 5/5.50 req (1.6.2) or a 7/8.2rqs ( 1.7.0 notice the little change )
 ( a simple html file is giving a 385rqs and a 404 error page give 
 around a 280/320rqs )

 The profile result give me a 59% time consume by Layout ( which I
 doesn't have on the speed app ) and another 12.5% to Translate
 ( ok I'm using tmx which is not the most speedy thing )
>>> You can save me a little time and effort here by attaching the layout
>>> script you use, as well as a count of the number of times calls are made
>>> to translate items. With that information, I can add some information to
>>> our performance and profiling test suite.
>>>
>> Quickly I'm calling the index controlleur / index view with layout.
>> html/index.php
>> -> ZFApplication ( which is the real bootstrap )
>> -> app/Module/Default
>> -> /Controller/indexController   
>>  -> Action indexAction
>> -> Scripts/index/index.phtml
>>  
>> Layout contain
>> |-- common
>> |   |-- footer.phtml
>> |   |-- header.phtml
>> |   |-- help.phtml
>> |   `-- menu.phtml
>> `-- main.phtml
>>
>> For the index view there's a test
>> if ( !Zend_Auth::getInstance()-> hasIdentity() ):
>> // Render login form or logged
>> echo $this-> action(null, 'login');
>>// If we are anonymous
>>
>> --
>> For translation I've a global function __($str) which translate strings.
>>
>> For the whole projet there's a 945 call to it.
>>
>> For the index call profiled it's about 24 calls.
> The above may very well be the culprit, but I'll write a test just to
> see.
>
> Can you give the contents of your layout files? I'm curious to see how
> you're pulling in content -- if you're using partial(), action(), or
> simply render(). I've already identified a bottleneck in partial() that
> I'll be working on. Additionally, I typically recommend against action()
> because I know already that internally it's expensive; it's cheaper to
> create a helper that pulls from the model directly.
>
 If what you say is correct, I'm in trouble :-)

 You will see why in the source attached ...

 So I'm waiting your confirmation, and eventually other recommandations.
 There's some refactoring/rewritting in the air tonight :-)
>>> The only reason to use partial() instead of render() is when you
>>> absolutely need a clean variable scope for the rendered view script. In
>>> your case, I'd recommend simply substituting render() for each time you
>>> use partial(); this will definitely improve speed.
>>>
>> Ok this remark make sense ... I think it should find it's place as remark in 
>> docs.
>>
>>> I see you're using action() to pull in a login form. Since you won't be
>>> worried about pre-populated values or validation, it may make more sense
>>> here to either instantiate the form object directly and display it, or
>>> create a view helper that does this. 
>> To be honest, I'm actually in a process to limits the number of view
>> helper to a quantic's number.
>> I feel I'm on the wrong way. Too strict perhaps in the logic approach
>> There a login controller in which the login form & logic reside so I'm
>> calling it because layout permit this,
>> leaving all login to it's own controller/model/form/view system.
> 
> Makes sense. Just remember that this is an expensive operation. You may
> want to consider a view helper that calls the action() helper, but
> caches the results.
> 
>>> See if the above changes help your performance. If not, the next
>>> thing I'd suggest trying to move to gettext for your translations to
>>> see if that speeds things up. If so, you may be able to develop
>>> using TMX, and write a build script that converts to gettext later.
>>>
>> I will give them a try on Thursday and Friday and keep you inform of
>> the result.
>>
>> In your Guru's opinion, shall I try the svn version of 1.7 or could I
>> stay with the PR release ?
> 
> I'd go with trunk; there are changes going in daily improving the
> release, and we'll be doing at least one bug hunting event before the
> release. (1.7 will be branc

Re: [fw-general] Action helper and Layout

2008-10-23 Thread Marko Korhonen

Hi Jani,

I expected something like this with the request process.

I still have the option to call these actions with ajax so they
will be truly independent.


kr, Marko



Jani Hartikainen wrote:
> 
> The actions called with the action helper are all called
> inside the same request process as your main action, so
> you can't use Zend_Layout for giving the sub-actions different
> layouts.
> 
> Perhaps you could render the action-specific layouts inside
> the layout itself, using $this->render($layout), and calling
> the action helper inside that? Not 100% sure if that'll work
> though. Another way could be to use the layout parameter to
> simply switch to a different viewscript inside the sub action
> instead of changing the layout.
> 
> -- 
> Jani Hartikainen
> http://codeutopia.net/
> 
> On Thu, 23 Oct 2008 22:38:04 +0300, Marko Korhonen  
> <[EMAIL PROTECTED]> wrote:
> 
>> Hi,
>>
>> I make calls to another actions with action view helper.
>> $this->action(action, controller, module, params_array)
>>
>> For example, I want to call some module/controller/action for the  
>> content of
>> the left pane.
>>
>> I also pass the param "layout" in action call.
>>
>> BUT, when I expect the rendered action call rendered with layout I  
>> defined
>> as param,
>> my main view changes it's layout.
>>
>> Is this bug or expected behaviour and how should I resolve this?
>>
>> kr, Marko
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Action-helper-and-Layout-tp20138119p20138615.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] ZF performances / profiling the culprit

2008-10-23 Thread Benjamin Eberlei
hello,

you might want to install pecl-xdebug extension to PHP and enable profiling.
You can then use Webgrind or KCachegrind to show you which functions and 
classes use the most processing power in your appliaction.

Have you installed APC or eAccelerator?

On Thursday 23 October 2008 22:04:40 Bruno Friedmann wrote:
> Follow at the end
>
> Matthew Weier O'Phinney wrote:
> > -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> >
> > (on Tuesday, 21 October 2008, 09:45 PM +0200):
> >> Matthew Weier O'Phinney wrote:
> >>> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> >>>
> >>> (on Tuesday, 21 October 2008, 06:56 AM +0200):
>  Matthew Weier O'Phinney wrote:
> > -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> >
> > (on Monday, 20 October 2008, 07:00 AM +0200):
> >> Matthew Weier O'Phinney wrote:
> >>> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> >>>
> >>> (on Sunday, 19 October 2008, 07:30 PM +0200):
>  With the help of ZendStudio, I'm trying to understand why on one
>  application I've got 25/30 req/s and on the second one I've only a
>  5/5.50 req (1.6.2) or a 7/8.2rqs ( 1.7.0 notice the little change
>  ) ( a simple html file is giving a 385rqs and a 404 error page
>  give around a 280/320rqs )
> 
>  The profile result give me a 59% time consume by Layout ( which I
>  doesn't have on the speed app ) and another 12.5% to Translate
>  ( ok I'm using tmx which is not the most speedy thing )
> >>>
> >>> You can save me a little time and effort here by attaching the
> >>> layout script you use, as well as a count of the number of times
> >>> calls are made to translate items. With that information, I can add
> >>> some information to our performance and profiling test suite.
> >>
> >> Quickly I'm calling the index controlleur / index view with layout.
> >> html/index.php
> >> -> ZFApplication ( which is the real bootstrap )
> >> -> app/Module/Default
> >> -> /Controller/indexController
> >>-> Action indexAction
> >> -> Scripts/index/index.phtml
> >>
> >> Layout contain
> >>
> >> |-- common
> >> |
> >> |   |-- footer.phtml
> >> |   |-- header.phtml
> >> |   |-- help.phtml
> >> |
> >> |   `-- menu.phtml
> >>
> >> `-- main.phtml
> >>
> >> For the index view there's a test
> >> if ( !Zend_Auth::getInstance()-> hasIdentity() ):
> >> // Render login form or logged
> >> echo $this-> action(null, 'login');
> >>// If we are anonymous
> >>
> >> --
> >> For translation I've a global function __($str) which translate
> >> strings.
> >>
> >> For the whole projet there's a 945 call to it.
> >>
> >> For the index call profiled it's about 24 calls.
> >
> > The above may very well be the culprit, but I'll write a test just to
> > see.
> >
> > Can you give the contents of your layout files? I'm curious to see
> > how you're pulling in content -- if you're using partial(), action(),
> > or simply render(). I've already identified a bottleneck in partial()
> > that I'll be working on. Additionally, I typically recommend against
> > action() because I know already that internally it's expensive; it's
> > cheaper to create a helper that pulls from the model directly.
> 
>  If what you say is correct, I'm in trouble :-)
> 
>  You will see why in the source attached ...
> 
>  So I'm waiting your confirmation, and eventually other
>  recommandations. There's some refactoring/rewritting in the air
>  tonight :-)
> >>>
> >>> The only reason to use partial() instead of render() is when you
> >>> absolutely need a clean variable scope for the rendered view script. In
> >>> your case, I'd recommend simply substituting render() for each time you
> >>> use partial(); this will definitely improve speed.
> >>
> >> Ok this remark make sense ... I think it should find it's place as
> >> remark in docs.
> >>
> >>> I see you're using action() to pull in a login form. Since you won't be
> >>> worried about pre-populated values or validation, it may make more
> >>> sense here to either instantiate the form object directly and display
> >>> it, or create a view helper that does this.
> >>
> >> To be honest, I'm actually in a process to limits the number of view
> >> helper to a quantic's number.
> >> I feel I'm on the wrong way. Too strict perhaps in the logic approach
> >> There a login controller in which the login form & logic reside so I'm
> >> calling it because layout permit this,
> >> leaving all login to it's own controller/model/form/view system.
> >
> > Makes sense. Just remember that this is an expensive operation. You may
> > want to consider a view helper that calls the action() helper, but
> > caches the results.
> >
> >>> See if the above changes help 

[fw-general] ZF performance wiki entry

2008-10-23 Thread till
On Thu, Oct 23, 2008 at 10:19 PM, Benjamin Eberlei <[EMAIL PROTECTED]> wrote:
> hello,
>
> you might want to install pecl-xdebug extension to PHP and enable profiling.
> You can then use Webgrind or KCachegrind to show you which functions and
> classes use the most processing power in your appliaction.
>
> Have you installed APC or eAccelerator?

This is one of the things that helps...

I think getting more performance is one of the most confusing topics
here. It's already very confusing without ZF, e.g. require_once,
include_once, absolute paths, __autoload, spl, etc.. But since there
is a page/category already, does anyone feel like extending it a bit?

http://framework.zend.com/wiki/display/ZFDEV/Performance+of+ZF


Cheers,
Till


Re: Re: [fw-general] Framework setup for local dev. and shared hosting.

2008-10-23 Thread Chris Martin

I was looking at the Quickstart again just now - my aforementioned .htaccess
is inflexible with all of those specific extensions. This is better:

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


Chris Martin wrote:
> 
> 
> My index.php/.htaccess setup is modified a bit...
> I have an .htaccess file in my project root folder that rewrites all
> requests to a index.php which is also in my project root folder. For any
> images/css/js/etc. that I want to access from my project/public/ folder, I
> have a rewrite filter to allow them through based on file extension:
> 
>RewriteEngine on
>RewriteRule !\.(js|ico|gif|jpg|png|css|mpg|avi|swf|html|htm)$ index.php
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Framework-setup-for-local-dev.-and-shared-hosting.-tp20108467p20138851.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] ZF performance wiki entry

2008-10-23 Thread Matthew Weier O'Phinney
-- till <[EMAIL PROTECTED]> wrote
(on Thursday, 23 October 2008, 10:27 PM +0200):
> On Thu, Oct 23, 2008 at 10:19 PM, Benjamin Eberlei <[EMAIL PROTECTED]> wrote:
> > you might want to install pecl-xdebug extension to PHP and enable profiling.
> > You can then use Webgrind or KCachegrind to show you which functions and
> > classes use the most processing power in your appliaction.
> >
> > Have you installed APC or eAccelerator?
> 
> This is one of the things that helps...
> 
> I think getting more performance is one of the most confusing topics
> here. It's already very confusing without ZF, e.g. require_once,
> include_once, absolute paths, __autoload, spl, etc.. But since there
> is a page/category already, does anyone feel like extending it a bit?
> 
> http://framework.zend.com/wiki/display/ZFDEV/Performance+of+ZF

I plan on adding a peformance chapter for the 1.7 release, particularly
once we finish the changes we're introducing. If anybody has any tips,
post them on the above wiki page, and we'll try to verify them in our
performance lab.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] error in JQuery datepicker?

2008-10-23 Thread Bart McLeod

Hi all,

   $elem = new ZendX_JQuery_Form_Element_DatePicker("begin", 
"12.12.2007", array(), array());

   $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
   $this->addElement($elem);

yields:
*Catchable fatal error*: Argument 4 passed to 
ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array, null 
given in 
*E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on 
line *54


*while:

   $elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*", 
"12.12.2007", array(), array());

   $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
   $this->addElement($elem);

gets a datepicker. See the difference? The id! The id cannot be called 
'begin'. It can be called 'begin1'. Maybe there is something in my form 
magic that it causing this. So I should try this without any magic, in a 
very simple form. Wanted to share it with you before I forget.


Bart


Re: [fw-general] error in JQuery datepicker?

2008-10-23 Thread Bart McLeod
By now, I found that the error is due to some internal magic I use for 
my forms. Still a strange error.
I was able to use a ZendX_JQuery_Form_Element_Datepicker, named 'begin'  
in a regular form that has no magic to it.


Bart

Bart McLeod schreef:

Hi all,

$elem = new ZendX_JQuery_Form_Element_DatePicker("begin", 
"12.12.2007", array(), array());

$elem->setJQueryParam('dateFormat', 'dd.mm.yy');
$this->addElement($elem);

yields:
*Catchable fatal error*: Argument 4 passed to 
ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array, 
null given in 
*E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on 
line *54


*while:

$elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*", 
"12.12.2007", array(), array());

$elem->setJQueryParam('dateFormat', 'dd.mm.yy');
$this->addElement($elem);

gets a datepicker. See the difference? The id! The id cannot be called 
'begin'. It can be called 'begin1'. Maybe there is something in my 
form magic that it causing this. So I should try this without any 
magic, in a very simple form. Wanted to share it with you before I forget.


Bart


Re: [fw-general] error in JQuery datepicker?

2008-10-23 Thread Benjamin Eberlei
so this is not at all  ZendX_JQuery related? its due to your own form 
implementation? i have already created a bug report, i will close it then if 
you can confirm that.

On Thursday 23 October 2008 23:31:41 Bart McLeod wrote:
> By now, I found that the error is due to some internal magic I use for
> my forms. Still a strange error.
> I was able to use a ZendX_JQuery_Form_Element_Datepicker, named 'begin'
> in a regular form that has no magic to it.
>
> Bart
>
> Bart McLeod schreef:
> > Hi all,
> >
> > $elem = new ZendX_JQuery_Form_Element_DatePicker("begin",
> > "12.12.2007", array(), array());
> > $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> > $this->addElement($elem);
> >
> > yields:
> > *Catchable fatal error*: Argument 4 passed to
> > ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array,
> > null given in
> > *E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on
> > line *54
> >
> > *while:
> >
> > $elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*",
> > "12.12.2007", array(), array());
> > $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> > $this->addElement($elem);
> >
> > gets a datepicker. See the difference? The id! The id cannot be called
> > 'begin'. It can be called 'begin1'. Maybe there is something in my
> > form magic that it causing this. So I should try this without any
> > magic, in a very simple form. Wanted to share it with you before I
> > forget.
> >
> > Bart



-- 
Benjamin Eberlei
http://www.beberlei.de


Re: [fw-general] Zend_Acl_Resource MultiDimensional Array

2008-10-23 Thread nwhiting

Well incase anyone else ever runs into this problem I have found a simple
autoParse function that can be pluged into the Acl Resource systemof
course youl need to change the $this->zendAcl to your own object reference (
but it works like a charm:) )

public function parseResourceList($list, $parent = null)
{
if (is_array($list))
{
foreach ($list as $key => $val)
{
if ( !is_array($val) )
{
if( $parent != null )
{
if($this->zendAcl->has($parent))
{
// Add child resource 
from parent
$this->zendAcl->add( 
new Zend_Acl_Resource($val), $parent);
}
else
{
// Add parent then 
resource
$this->zendAcl->add( 
new Zend_Acl_Resource($parent));
$this->zendAcl->add( 
new Zend_Acl_Resource($val), $parent);
}
}
else
{
// Add parent resource
$this->zendAcl->add( new 
Zend_Acl_Resource($val));

}
}
else
{
$this->parseResourceList($val, $key);
}
}
}
else
{
$this->zendAcl->add( new Zend_Acl_Resource($list));
}
}

-
Nickolas Whiting 

Developer 

http://xstudiosinc.com Xstudios 
-- 
View this message in context: 
http://www.nabble.com/Zend_Acl_Resource-MultiDimensional-Array-tp20137968p20140236.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] error in JQuery datepicker?

2008-10-23 Thread Bart McLeod

Hi Benjamin,

Yes and no. I know where to look to find out what is happening. It would 
have been nice if this element would have been completely compatible 
with all the tricks I play. For now, just close the bugreport. If I find 
a compatibility issue later, that I can describe more properly, I will 
let you know.


At the moment, I am a little sad that using jquery directly is simpler 
than using its'  ZF integrated counterpart. I was expecting the 
opposite...but I will not give up yet.


Regards,

Bart

Benjamin Eberlei schreef:
so this is not at all  ZendX_JQuery related? its due to your own form 
implementation? i have already created a bug report, i will close it then if 
you can confirm that.


On Thursday 23 October 2008 23:31:41 Bart McLeod wrote:
  

By now, I found that the error is due to some internal magic I use for
my forms. Still a strange error.
I was able to use a ZendX_JQuery_Form_Element_Datepicker, named 'begin'
in a regular form that has no magic to it.

Bart

Bart McLeod schreef:


Hi all,

$elem = new ZendX_JQuery_Form_Element_DatePicker("begin",
"12.12.2007", array(), array());
$elem->setJQueryParam('dateFormat', 'dd.mm.yy');
$this->addElement($elem);

yields:
*Catchable fatal error*: Argument 4 passed to
ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array,
null given in
*E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on
line *54

*while:

$elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*",
"12.12.2007", array(), array());
$elem->setJQueryParam('dateFormat', 'dd.mm.yy');
$this->addElement($elem);

gets a datepicker. See the difference? The id! The id cannot be called
'begin'. It can be called 'begin1'. Maybe there is something in my
form magic that it causing this. So I should try this without any
magic, in a very simple form. Wanted to share it with you before I
forget.

Bart
  




  


Re: [fw-general] ZF performance wiki entry

2008-10-23 Thread till
On Thu, Oct 23, 2008 at 10:49 PM, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> -- till <[EMAIL PROTECTED]> wrote
> (on Thursday, 23 October 2008, 10:27 PM +0200):
>> On Thu, Oct 23, 2008 at 10:19 PM, Benjamin Eberlei <[EMAIL PROTECTED]> wrote:
>> > you might want to install pecl-xdebug extension to PHP and enable 
>> > profiling.
>> > You can then use Webgrind or KCachegrind to show you which functions and
>> > classes use the most processing power in your appliaction.
>> >
>> > Have you installed APC or eAccelerator?
>>
>> This is one of the things that helps...
>>
>> I think getting more performance is one of the most confusing topics
>> here. It's already very confusing without ZF, e.g. require_once,
>> include_once, absolute paths, __autoload, spl, etc.. But since there
>> is a page/category already, does anyone feel like extending it a bit?
>>
>> http://framework.zend.com/wiki/display/ZFDEV/Performance+of+ZF
>
> I plan on adding a peformance chapter for the 1.7 release, particularly
> once we finish the changes we're introducing. If anybody has any tips,
> post them on the above wiki page, and we'll try to verify them in our
> performance lab.
>

Sounds pretty good. I'd add some to the wiki as well, but I don't
think I know how to create a new page in it. Or maybe I lack
permissions? Or whatever. I'll add the performance chapter to my watch
and help extending it when it starts.

Till


Re: [fw-general] error in JQuery datepicker?

2008-10-23 Thread Matthew Ratzloff
>
> It would have been nice if this element would have been completely
> compatible with all the tricks I play.
>

What tricks are those?
-Matt

On Thu, Oct 23, 2008 at 2:57 PM, Bart McLeod <[EMAIL PROTECTED]> wrote:

>  Hi Benjamin,
>
> Yes and no. I know where to look to find out what is happening. It would
> have been nice if this element would have been completely compatible with
> all the tricks I play. For now, just close the bugreport. If I find a
> compatibility issue later, that I can describe more properly, I will let you
> know.
>
> At the moment, I am a little sad that using jquery directly is simpler than
> using its'  ZF integrated counterpart. I was expecting the opposite...but I
> will not give up yet.
>
> Regards,
>
> Bart
>
> Benjamin Eberlei schreef:
>
> so this is not at all  ZendX_JQuery related? its due to your own form
> implementation? i have already created a bug report, i will close it then if
> you can confirm that.
>
> On Thursday 23 October 2008 23:31:41 Bart McLeod wrote:
>
>
>  By now, I found that the error is due to some internal magic I use for
> my forms. Still a strange error.
> I was able to use a ZendX_JQuery_Form_Element_Datepicker, named 'begin'
> in a regular form that has no magic to it.
>
> Bart
>
> Bart McLeod schreef:
>
>
>  Hi all,
>
> $elem = new ZendX_JQuery_Form_Element_DatePicker("begin",
> "12.12.2007", array(), array());
> $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> $this->addElement($elem);
>
> yields:
> *Catchable fatal error*: Argument 4 passed to
> ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array,
> null given in
> *E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on
> line *54
>
> *while:
>
> $elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*",
> "12.12.2007", array(), array());
> $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> $this->addElement($elem);
>
> gets a datepicker. See the difference? The id! The id cannot be called
> 'begin'. It can be called 'begin1'. Maybe there is something in my
> form magic that it causing this. So I should try this without any
> magic, in a very simple form. Wanted to share it with you before I
> forget.
>
> Bart
>
>
>


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

2008-10-23 Thread Fabien MARTY
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




On Wed, Oct 22, 2008 at 5:34 PM, Diabl0 <[EMAIL PROTECTED]> wrote:
> Colin Guthrie pisze:
>>
>> Diabl0 wrote:
>>>
>>> Hi
>>>
>>> As i seen this topic was discussed later, but i have new idea that IMHO
>>> can throw new light.
>>>
>>> What about combining memory cache backends with file cache fallback for
>>> tags? Ofcorse optional if someone wants this.
>>>
>>> This should give us benefits from fast memory cache and tagging system
>>> with only small drawback on performance needed to update (or retreive) tags
>>> cache from filesystem.
>>>
>>> And what you think about this idea?
>>
>> It's interesting but why use the filesystem? Why not use the cache itself
>> but use a different key structure to track this (e.g. cache an array of keys
>> that match the tag "wibble" under the key name "Zend_Cache-keymap-wibble"?
>> This approach could be implemented in a base class and those backends not
>> supporting tags could simple extend it. I've not looked at the intricacies
>> of this from a data integrity point of view so there could be several
>> reasons why this wouldn't work :)
>
> Filesystem was my first idea, but db and any other "solid" backend is good.
> Memcached and other memory based backends aren't good because it's content
> can be deleted in any time.
>
>> Also as a related issue, would it be possible to implement a cache
>> invalidation queue system backed by a database? The reason I say this is
>> when considering multi-server environments (let's assume there is one
>> database for all servers).
>
>   See my post with Mao_Cache. I didn't tested it with DB yet, but i was also
> thinking about clustered enviroments.
>
> --
> K.
>
>



-- 
Fabien MARTY
[EMAIL PROTECTED]


[fw-general] Dijit Editor

2008-10-23 Thread Matthew Lurz

I've been unable to get the Dijit.Editor element to work using trunk or the
the 1.7 preview release. When using Dojo 1.2, from either the official Dojo
1.2 release or CDN, I receive this error: "RichText should not be used with
the TEXTAREA tag. See dijit._editor.RichText docs.". When using Dojo from
trunk or the 1.7 preview release I receive the same error as well as the
errors due to the following missing files.

dijit/form/nls/en/Textarea.js
dijit/_editor/nls/en/commands.js
-- 
View this message in context: 
http://www.nabble.com/Dijit-Editor-tp20141019p20141019.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Setting default auth object

2008-10-23 Thread tony stamp

Hello

I have a controller that displays the latest news on the index page on my
site. Obviously, its called newsController that has the action latestNews
(called from the view's action helper).

Now i am developing the admin side of the site, it makes sense that i put
the add/edit/delete actions in the same newscontroller. However, if i define
access rules for these actions via zend_acl, it rules out the chance of
calling the latestAction for users not logged in.

Ideally, in the acl, i would like to define something like:
$this->allow(null, 'news', array('latest'));
...meaning that users with no role can only view the latestAction on the
news controller. Futher refinement of add/edit/delete can be defined for
mods/admins etc.
But the above is not possible, so i (think) i have two options - split the
functionality into two separate controllers - a latest news controller
(containing just the latestAction), accessible by non-logged in users,
followed by a news manager type of controller (for the crud actions for
logged in users) which is governed by the acl.

Alternatively, if there is a way of setting a sort of base credential using
zend_auth ie guest or siteVisitor, which can then be defined to view only
the latestAction on a single news controller?

hmmm... 
-- 
View this message in context: 
http://www.nabble.com/Setting-default-auth-object-tp20141150p20141150.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Setting default auth object

2008-10-23 Thread Tim Nagel
You should be able to set up a guest role and assign that to any user not
logged in. Not sure how you've set up Zend_Auth and Zend_Acl, but thats what
we've been doing.

Every action we define in our projects has an ->allow() call even if
everyone is able to access it.


Tim

On Fri, Oct 24, 2008 at 09:54, tony stamp <[EMAIL PROTECTED]> wrote:

>
> Hello
>
> I have a controller that displays the latest news on the index page on my
> site. Obviously, its called newsController that has the action latestNews
> (called from the view's action helper).
>
> Now i am developing the admin side of the site, it makes sense that i put
> the add/edit/delete actions in the same newscontroller. However, if i
> define
> access rules for these actions via zend_acl, it rules out the chance of
> calling the latestAction for users not logged in.
>
> Ideally, in the acl, i would like to define something like:
> $this->allow(null, 'news', array('latest'));
> ...meaning that users with no role can only view the latestAction on the
> news controller. Futher refinement of add/edit/delete can be defined for
> mods/admins etc.
> But the above is not possible, so i (think) i have two options - split the
> functionality into two separate controllers - a latest news controller
> (containing just the latestAction), accessible by non-logged in users,
> followed by a news manager type of controller (for the crud actions for
> logged in users) which is governed by the acl.
>
> Alternatively, if there is a way of setting a sort of base credential using
> zend_auth ie guest or siteVisitor, which can then be defined to view only
> the latestAction on a single news controller?
>
> hmmm...
> --
> View this message in context:
> http://www.nabble.com/Setting-default-auth-object-tp20141150p20141150.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] Looking for a complete Complete Zend_Paginator example

2008-10-23 Thread ashish.sharma

I am using the following code WITHOUT using fetchAll() .. am I doing it
right? 

==
$select = $this->select();

$select->from($this, $cols);

if ($where) {
$select->where($where);
}   

if ($order) {   
$select->order($order); 

}   

Zend_Loader::loadClass('Zend_Paginator');
$objPaginator = Zend_Paginator::factory($select);

==

Please correct me where I am wrong.

Thanks
Ashish Sharma



Matthew Ratzloff wrote:
> 
> print_r() will not work.
> You should not fetch the rows.  You should pass the Select object directly
> to the Paginator's factory() method.  It only selects the rows necessary.
> 
> -Matt
> 
> On Thu, Oct 23, 2008 at 6:31 AM, ashish.sharma <
> [EMAIL PROTECTED]> wrote:
> 
>>
>> Nothing seems to be working.
>>
>> Used the code snippet but when I "print_r()" he paginator then I am not
>> able
>> to see the total number of records, total pages formed etc.
>>
>> Also, I m not sure whether use of fetchAll is appropriate or not. What is
>> the use of fetching all the records? Can't we do something like .. just
>> fetch the rows to be displayed and the count(*) of the query to get the
>> total records.
>>
>> Kindly advice!
>>
>> Ashish Sharma
>> TL R&D
>>
>>
>>
>> 411161 wrote:
>> >
>> > I have it working, but I am not sure how to create links for next,
>> last,
>> > first, previous, numbers, etc.. I am also not sure how to handle links
>> in
>> > my controller.
>> > This is what I have so far."
>> >
>> > controller:
>> >   public function paginateAction()  {
>> >
>> >   $sql = 'SELECT * FROM runz_miles WHERE empl_no = 31713';
>> >   $this->view->result = $this->db->fetchAll($sql);
>> >   $paginator =
>> Zend_Paginator::factory($this->view->result);
>> >   $paginator->setCurrentPageNumber(15);
>> >   $this->view->paginator = $paginator;
>> >   }
>> >
>> > in my view I have:
>> > 
>> > > > foreach($this->paginator as $key => $row){
>> >
>> >   echo "" .$row['EMPL_NO']
>>  . "\n";
>> >   echo "" .$row['PRISM_ORG_CODE']
>> . "\n";
>> > }
>> > ?>
>> > 
>> >
>> > How do I create the links and I how do I handle the action so that it
>> will
>> > not try and call the sql again?
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Looking-for-a-complete-Complete-Zend_Paginator-example-tp19731530p20131009.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Looking-for-a-complete-Complete-Zend_Paginator-example-tp19731530p20144017.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Action helper and Layout

2008-10-23 Thread Marko Korhonen

hi again,

I extended Zend_View_Helper_Action to my own helper as follows:

class MyApp_View_Helper_Block extends Zend_View_Helper_Action
{
public function block($action, $controller, $module = null, array
$params = array(), $title = null, $layout = "block.phtml")
{
$view = new Zend_View();

$paths = $this->view->getScriptPaths();

foreach ($paths as $path)
{
$view->addScriptPath($path);
}

if ($title != null)
{
$view->title = $title;
}

$view->content = parent::action($action, $controller, $module,
$params);

return $view->render($layout);
}
}

and my block.phtml example:



title != null): ?>
title ?>


content ?>




br, Marko
-- 
View this message in context: 
http://www.nabble.com/Action-helper-and-Layout-tp20138119p20144664.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] error in JQuery datepicker?

2008-10-23 Thread Benjamin Eberlei
Hello Bart,

ok i'll close it. In my opinion using the view helpers is really easy, but the 
form elements are a bit hard to wield since the Element Decorator structure 
is quite complex which spills to the jQuery specific elements and decorators.

greetings,
Benjamin

On Thursday 23 October 2008 23:57:19 Bart McLeod wrote:
> Hi Benjamin,
>
> Yes and no. I know where to look to find out what is happening. It would
> have been nice if this element would have been completely compatible
> with all the tricks I play. For now, just close the bugreport. If I find
> a compatibility issue later, that I can describe more properly, I will
> let you know.
>
> At the moment, I am a little sad that using jquery directly is simpler
> than using its'  ZF integrated counterpart. I was expecting the
> opposite...but I will not give up yet.
>
> Regards,
>
> Bart
>
> Benjamin Eberlei schreef:
> > so this is not at all  ZendX_JQuery related? its due to your own form
> > implementation? i have already created a bug report, i will close it then
> > if you can confirm that.
> >
> > On Thursday 23 October 2008 23:31:41 Bart McLeod wrote:
> >> By now, I found that the error is due to some internal magic I use for
> >> my forms. Still a strange error.
> >> I was able to use a ZendX_JQuery_Form_Element_Datepicker, named 'begin'
> >> in a regular form that has no magic to it.
> >>
> >> Bart
> >>
> >> Bart McLeod schreef:
> >>> Hi all,
> >>>
> >>> $elem = new ZendX_JQuery_Form_Element_DatePicker("begin",
> >>> "12.12.2007", array(), array());
> >>> $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> >>> $this->addElement($elem);
> >>>
> >>> yields:
> >>> *Catchable fatal error*: Argument 4 passed to
> >>> ZendX_JQuery_View_Helper_DatePicker::datePicker() must be an array,
> >>> null given in
> >>> *E:\ZendFramework\library\ZendX\JQuery\View\Helper\DatePicker.php* on
> >>> line *54
> >>>
> >>> *while:
> >>>
> >>> $elem = new ZendX_JQuery_Form_Element_DatePicker("*begin1*",
> >>> "12.12.2007", array(), array());
> >>> $elem->setJQueryParam('dateFormat', 'dd.mm.yy');
> >>> $this->addElement($elem);
> >>>
> >>> gets a datepicker. See the difference? The id! The id cannot be called
> >>> 'begin'. It can be called 'begin1'. Maybe there is something in my
> >>> form magic that it causing this. So I should try this without any
> >>> magic, in a very simple form. Wanted to share it with you before I
> >>> forget.
> >>>
> >>> Bart



-- 
Benjamin Eberlei
http://www.beberlei.de