RE: [fw-general] FCKEditor and Zend_Form integration

2008-11-20 Thread aSecondWill


These view helpers are great, thanks.

Is it possible to apply them to form elements within your form classes , eg
Forms_Cms extends Zend_Form 

so that zend_form populate and validate still works, but with the fckEditor
functionality too?

Will


gammamatrix wrote:
> 
> I created a view helper as well with the option of including extra
> options:
> 

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



[fw-general] Re: $cache->start() and caching with Zend_Translate together, possible bug?

2008-11-20 Thread kirpit
Ok, what I do, I write here step by step.

I have re-downloaded ZF 1.7. I removed everything under TEMP_DIR folder. I
removed every single localhost cookie.

I commented $cache->start(); line and uncommented
Zend_Translate::setCache($cache); line. And I have entered main page.
Everything looks very fine (while not cache hitting) and I have a file
zend_cache--zend_translate_full_csv_file_path filled with correct
translation table, serialized under temp dir next to some small metadata
files.

Then I removed again cookies and everything under temp dir. I comment
translate cache and uncomment $cache->start(). There is no cache hit as
expected. I do have fetched output in a file named zend_cache--someMd5 but i
do not have any cache file about zend_translation under temp dir as
expected.

I only remove cookies, leaving temp dir as it is. There is cache hit as
expected and response time is 19ms (wow, here i adore ZF).

I check cookies (well there is none as cache hits), remove files under temp
folder. I uncomment both of them. Enter the mainpage. What i have under temp
dir is a file named zend_cache--zend_translate_full_csv_file_path. And guess
what is inside? Fetched and serialized html output of page! :)

Yes, there is no any other file bigger than 1 kb. under temp.

Bug?

-- Yönlendirilmiş ileti --
From: "Thomas Weidner" <[EMAIL PROTECTED]>
To: 
Date: Thu, 20 Nov 2008 07:34:19 +0100
Subject: Re: [fw-general] $cache->start() and caching with Zend_Translate
together, possible bug?
Sorry, but on the first look this seems to be a cache problem and not a
translation one.
Looking at the lines you provide I see that at line 435 the cache is
loaded...
$result = self::$_cache->load($id);
which happens without problems.

And then the cache is unserialized.
unserialize($result);
All translate classes are serializing the data before writing to cache so
this can not be a problem.

In my opinion there are only 4 things which can corrupt this behaviour.

1.) You are using an outdated cache after an update of ZF
2.) Someone writes manually to the translation cache without serializing the
data
3.) Someone uses own written adapter which corrupt the cache
4.) You have a corrupted ZF version... try a update to fix the broken files

Of course it could be that there is a problem in Zend_Cache itself, but I
dont believe this, because your problem is thrown in unserialize. Why should
Zend_Cache change the stored data. And Zend_Translate stores only serialized
strings.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com


2008/11/20 kirpit <[EMAIL PROTECTED]>

> Hi ZF people.
>
> I have following lines in bootstrap with ZF v1.7 running on php 5.2.6:
>
> >
>
> $cache = Zend_Cache::factory('Page', 'File', array(
>  'lifetime' => 60 * 60 * 12,
>  'regexps' => array(
>   // cache whole indexController
>   '^' . BASE_PATH . '$' => array(
>   'cache' => true),
>   // cache whole indexController
>   '^' . BASE_PATH . 'index' => array(
>   'cache' => true),
>   // cache whole iController
>   '^' . BASE_PATH . 'i/' => array(
>   'cache' => true),
>   // cache ajax/get-suggest
>   '^' . BASE_PATH . 'ajax/get-suggest' => array(
>   'cache' => true,
>   'cache_with_get_variables' => true,
>   'cache_with_session_variables' => true,
>   'cache_with_cookie_variables' => true,
>   'make_id_with_get_variables' => true,
>   'make_id_with_session_variables' => false,
>   'make_id_with_cookie_variables' => false))), array(
>  'cache_dir' => TEMP_DIR));
> $cache->start();
>
> // ... more later
>
> Zend_Translate::setCache($cache);
> $translate = new Zend_Translate('csv', DOC_ROOT . 'language' . DS .
> 'tr_TR.csv', 'tr_TR');
> Zend_Registry::set('Zend_Translate', $translate);
>
> >
>
> And it produces following errors:
>
> Warning: unserialize() expects parameter 1 to be string, array given in
> ...\Zend\Translate\Adapter.php on line 436
>
> Notice: No translation for the language 'tr_TR' available. in
> ...\Zend\Translate\Adapter.php on line 307
>
> Notice: No translation for the language 'tr_TR' available. in
> ...\Zend\Translate\Adapter.php on line 307
>
> Notice: No translation for the language 'tr_TR' available. in
> ...\Zend\Translate\Adapter.php on line 307
>
> When I comment one of the cache feature, either $cache->start()
> or Zend_Translate::setCache($cache); everything looks fine. I have found
> similar bug below link but it says it is fixed already:
> http://framework.zend.com/issues/browse/ZF-3930
>
> Could be a bug?
>
>
>


Re: [fw-general] Passing an array from PHP to Javascript

2008-11-20 Thread Cameron
heh, suck up :P

On Fri, Nov 21, 2008 at 8:35 AM, Ben Scholzen 'DASPRiD' <[EMAIL 
PROTECTED]>wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Uhm, sorry, the correct answer is Zend_Json ;)
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : [EMAIL PROTECTED]   :
> : Jabber : [EMAIL PROTECTED] :
> : ICQ: 105677955  :
> :::
>
>
> Cameron schrieb:
> > that's what JSON is for. It's a serialized javascript array, so you
> > simply serialize the array in javascript, pass it through to your PHP
> > app, and there are JSON tools in PHP to instantly decode / encode the
> > arrays. http://www.php.net/json for more info!
> >
> > On Fri, Nov 21, 2008 at 5:16 AM, cali_dotocm <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > thanks for the solution, it was quiet helpful. i had the exact same
> > problem.
> > i just have a little problem though. how qould i the fetch the array
> of
> > values back in php(zend). that has proven to be a problem?
> > --
> > View this message in context:
> >
> http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p20609153.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
> >
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkkl9D4ACgkQ0HfT5Ws789BkLwCgkZnWUtvLmg0JfXr/4AxZLinH
> G2MAoK4JyeLjx3SpspMRBSfY4i9aATwV
> =pIWk
> -END PGP SIGNATURE-
>


Re: [fw-general] Zend_Rest_Response, obtaining a value

2008-11-20 Thread issackelly

in other places, for the REST_RESPONSE class, you can call xml elements like
that dynamically,

even still accessing the variable directly is not possible because of the -

remaining-hits would be translated to $remaining ( minus ) $hits.



dan.latter wrote:
> 
> remaing-hits is not a function, maybe that's your problem, ie drop the  
> "()"
> 
> 
> On Nov 20, 2008, at 21:00, issackelly <[EMAIL PROTECTED]> wrote:
> 
>>
>> I'm tring to obtain the value remaining-hits
>>
>> from this object (we'll call it response)
>> object(Zend_Rest_Client_Result)#10 (1) {
>>  ["_sxml:protected"]=>
>>  object(SimpleXMLElement)#8 (4) {
>>["reset-time"]=>
>>string(25) "2008-11-20T21:36:50+00:00"
>>["remaining-hits"]=>
>>string(2) "98"
>>["hourly-limit"]=>
>>string(3) "100"
>>["reset-time-in-seconds"]=>
>>string(10) "1227217010"
>>  }
>> }
>>
>> $response->remaining-hits() doesn't work, because the - isn't a  
>> valid PHP
>> element.
>>
>> This is a total noobie question, but I'm wondering how to access  
>> that value
>> correctly.  Thanks
>> -- 
>> View this message in context:
>> http://www.nabble.com/Zend_Rest_Response%2C-obtaining-a-value-tp20609926p20609926.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Rest_Response%2C-obtaining-a-value-tp20609926p20612429.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-11-20 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Uhm, sorry, the correct answer is Zend_Json ;)
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


Cameron schrieb:
> that's what JSON is for. It's a serialized javascript array, so you
> simply serialize the array in javascript, pass it through to your PHP
> app, and there are JSON tools in PHP to instantly decode / encode the
> arrays. http://www.php.net/json for more info!
> 
> On Fri, Nov 21, 2008 at 5:16 AM, cali_dotocm <[EMAIL PROTECTED]
> > wrote:
> 
> 
> thanks for the solution, it was quiet helpful. i had the exact same
> problem.
> i just have a little problem though. how qould i the fetch the array of
> values back in php(zend). that has proven to be a problem?
> --
> View this message in context:
> 
> http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p20609153.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkl9D4ACgkQ0HfT5Ws789BkLwCgkZnWUtvLmg0JfXr/4AxZLinH
G2MAoK4JyeLjx3SpspMRBSfY4i9aATwV
=pIWk
-END PGP SIGNATURE-


Re: [fw-general] Zend_Rest_Response, obtaining a value

2008-11-20 Thread Daniel Latter
remaing-hits is not a function, maybe that's your problem, ie drop the  
"()"



On Nov 20, 2008, at 21:00, issackelly <[EMAIL PROTECTED]> wrote:



I'm tring to obtain the value remaining-hits

from this object (we'll call it response)
object(Zend_Rest_Client_Result)#10 (1) {
 ["_sxml:protected"]=>
 object(SimpleXMLElement)#8 (4) {
   ["reset-time"]=>
   string(25) "2008-11-20T21:36:50+00:00"
   ["remaining-hits"]=>
   string(2) "98"
   ["hourly-limit"]=>
   string(3) "100"
   ["reset-time-in-seconds"]=>
   string(10) "1227217010"
 }
}

$response->remaining-hits() doesn't work, because the - isn't a  
valid PHP

element.

This is a total noobie question, but I'm wondering how to access  
that value

correctly.  Thanks
--
View this message in context: 
http://www.nabble.com/Zend_Rest_Response%2C-obtaining-a-value-tp20609926p20609926.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-11-20 Thread Cameron
that's what JSON is for. It's a serialized javascript array, so you simply
serialize the array in javascript, pass it through to your PHP app, and
there are JSON tools in PHP to instantly decode / encode the arrays.
http://www.php.net/json for more info!

On Fri, Nov 21, 2008 at 5:16 AM, cali_dotocm <[EMAIL PROTECTED]> wrote:

>
> thanks for the solution, it was quiet helpful. i had the exact same
> problem.
> i just have a little problem though. how qould i the fetch the array of
> values back in php(zend). that has proven to be a problem?
> --
> View this message in context:
> http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p20609153.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] fetching arrays from js in php/zf for checkboxes

2008-11-20 Thread Cameron
At the risk of replying to your email with a one word answer, what you need
is JSON.


On Fri, Nov 21, 2008 at 6:37 AM, cali_dotocm <[EMAIL PROTECTED]> wrote:

>
> hi,
> i'm trying to figure out how to pass arrays back and forth from php to
> javascript and back in the zend framework. i need to do this for check
> boxes
> for a project and i canno use zend_form. i came up with a way to do this
> but
> the problem i have is that php cannot read the array string tha i pass to
> it. the javascript i used looks like this:
> [code]var cur="";
>var ajaxfields="";
>alert("field count:"+fields.length);
>
>if (fields.length > 0) {
>
>for (var t=0;t
>
>
> ajaxfields=ajaxfields+escape(fields[t])+"="+escape(document.getElementById(fields[t]).checked)+"&";
>
>}
>
>alert("ajaxfields:"+ajaxfields);
>
>var url="/articles/delete-field"
>var param="c=delete&"+ajaxfields+"sid="+Math.random();
>//alert("param");
>vpMakePostRequest(url, param, deletedone)
>}
> }[/code]
>
> when i alert the ajaxfields, this is how the string looks like:
>
> ajaxfields:47=false&48=false&49=false&50=true&51=false&52=false&53=false&.
>
> in th php script, i get the c paramemter using(zend):
>
> [code]  $this->c = $_POST['c'];
>echo $this->c;[/code]
> i echo for debugging purposes and i get "delete".
> now the problem is fetching the array string so i gp-could go ahead with
> the
> script.
> NOTE: i couldn't fetch it the same way.
>
> can anyone help me out
>
>
> --
> View this message in context:
> http://www.nabble.com/fetching-arrays-from-js-in-php-zf-for-checkboxes-tp20610507p20610507.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


[fw-general] fetching arrays from js in php/zf for checkboxes

2008-11-20 Thread cali_dotocm

hi,
i'm trying to figure out how to pass arrays back and forth from php to
javascript and back in the zend framework. i need to do this for check boxes
for a project and i canno use zend_form. i came up with a way to do this but
the problem i have is that php cannot read the array string tha i pass to
it. the javascript i used looks like this:
[code]var cur="";
var ajaxfields="";
alert("field count:"+fields.length);

if (fields.length > 0) {

for (var t=0;tc = $_POST['c'];
echo $this->c;[/code]
i echo for debugging purposes and i get "delete".
now the problem is fetching the array string so i gp-could go ahead with the
script.
NOTE: i couldn't fetch it the same way.

can anyone help me out


-- 
View this message in context: 
http://www.nabble.com/fetching-arrays-from-js-in-php-zf-for-checkboxes-tp20610507p20610507.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Rest_Response, obtaining a value

2008-11-20 Thread issackelly

I'm tring to obtain the value remaining-hits

from this object (we'll call it response)
object(Zend_Rest_Client_Result)#10 (1) {
  ["_sxml:protected"]=>
  object(SimpleXMLElement)#8 (4) {
["reset-time"]=>
string(25) "2008-11-20T21:36:50+00:00"
["remaining-hits"]=>
string(2) "98"
["hourly-limit"]=>
string(3) "100"
["reset-time-in-seconds"]=>
string(10) "1227217010"
  }
}

$response->remaining-hits() doesn't work, because the - isn't a valid PHP
element.

This is a total noobie question, but I'm wondering how to access that value
correctly.  Thanks
-- 
View this message in context: 
http://www.nabble.com/Zend_Rest_Response%2C-obtaining-a-value-tp20609926p20609926.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-11-20 Thread cali_dotocm

thanks for the solution, it was quiet helpful. i had the exact same problem.
i just have a little problem though. how qould i the fetch the array of
values back in php(zend). that has proven to be a problem?
-- 
View this message in context: 
http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p20609153.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Action Helper To Send Files?

2008-11-20 Thread Terre Porter

Here is trimmed down version of what I have for a file download function. In
my version the filename is generated by the action params, you would have
customize that part to your setup. Content Type would also have to be
modified, as they are getting pdf files this setup.

Maybe it will help.

public function downloadAction () {

// path to file
$timage = "/generate/real/path/to/file/";

// break file up
$tp = pathinfo($timage);

// disable mvx layout
Zend_Layout::getMvcInstance()->disableLayout();
// disable this view 
$this->_helper->viewRenderer->setNoRender();
// set headers
header("Content-Type: application/pdf");
header("Content-disposition: attachment;
filename=".$tp['basename'].";");
header("Content-Length: ".filesize($timage));
header('Content-Transfer-Encoding: Binary');
header('Accept-Ranges: bytes');
header('ETag: "'.md5($timage).'"');
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//send file data
// or print file_get_contents($timage);
readfile_chunked($timage);
} 

// pulled from php.net comments
function readfile_chunked($filename,$retbytes=true) {
   $chunksize =  15*1024; // how many bytes per chunk
   $buffer = '';
   $cnt =0;
   // $handle = fopen($filename, 'rb');
   $handle = fopen($filename, 'rb');
   if ($handle === false) {
   return false;
   }
   while (!feof($handle)) {
   $buffer = fread($handle, $chunksize);
   echo $buffer;
   ob_flush();
   flush();
   if ($retbytes) {
   $cnt += strlen($buffer);
   }
   unset($buffer);
   }
   $status = fclose($handle);
   if ($retbytes && $status) {
   return $cnt; // return num. bytes delivered like readfile()
does.
   }
   return $status;

}



-Original Message-
From: j5 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 20, 2008 2:30 PM
To: fw-general@lists.zend.com
Subject: Re: [fw-general] Action Helper To Send Files?


Should these callback functions be added to the action controller? Or added
as new methods of a class extending ContextSwitch?


Matthew Weier O'Phinney-3 wrote:
> 
> -- Sudheer <[EMAIL PROTECTED]> wrote (on Thursday, 20 
> November 2008, 06:48 PM +0530):
>> I have few questions:
>>
>> 1. Would it make sense to write a PDF file sender Action Helper for ZF?  
>> I was wondering whether we could add this feature to contextSwitch 
>> Action Helper.
>> 2. Or would it make more sense to write a generic file sender Action 
>> Helper with various adapters - PDF, CSV, Text, etc? 3. Does something 
>> like this exist already?
>>
>> The Action Helper would perform the following:
>> 1. Disable layout
>> 2. Disable view
>> 3. Set appropriate headers
>> 4. Send the file
> 
> ContextSwitch allows you to specify arbitrary callbacks to call 
> per-context; I'd simply use it and create a callback that performs 
> these tasks.
> 
> --
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
> 
> 

--
View this message in context:
http://www.nabble.com/Action-Helper-To-Send-Files--tp20600931p20608355.html
Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Action Helper To Send Files?

2008-11-20 Thread Matthew Weier O'Phinney
-- j5 <[EMAIL PROTECTED]> wrote
(on Thursday, 20 November 2008, 11:29 AM -0800):
> Should these callback functions be added to the action controller? Or added
> as new methods of a class extending ContextSwitch?


ContextSwitch allows for arbitrary callbacks -- any valid PHP callback
can be used. It's up to you to determine which works best for your
application.


> Matthew Weier O'Phinney-3 wrote:
> > -- Sudheer <[EMAIL PROTECTED]> wrote
> > (on Thursday, 20 November 2008, 06:48 PM +0530):
> > > I have few questions:
> > >
> > > 1. Would it make sense to write a PDF file sender Action Helper for ZF?  
> > > I was wondering whether we could add this feature to contextSwitch  
> > > Action Helper.
> > > 2. Or would it make more sense to write a generic file sender Action  
> > > Helper with various adapters - PDF, CSV, Text, etc? 3. Does something 
> > > like this exist already?
> > >
> > > The Action Helper would perform the following:
> > > 1. Disable layout
> > > 2. Disable view
> > > 3. Set appropriate headers
> > > 4. Send the file
> > 
> > ContextSwitch allows you to specify arbitrary callbacks to call
> > per-context; I'd simply use it and create a callback that performs these
> > tasks.

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


Re: [fw-general] Action Helper To Send Files?

2008-11-20 Thread j5

Should these callback functions be added to the action controller? Or added
as new methods of a class extending ContextSwitch?


Matthew Weier O'Phinney-3 wrote:
> 
> -- Sudheer <[EMAIL PROTECTED]> wrote
> (on Thursday, 20 November 2008, 06:48 PM +0530):
>> I have few questions:
>>
>> 1. Would it make sense to write a PDF file sender Action Helper for ZF?  
>> I was wondering whether we could add this feature to contextSwitch  
>> Action Helper.
>> 2. Or would it make more sense to write a generic file sender Action  
>> Helper with various adapters - PDF, CSV, Text, etc? 3. Does something 
>> like this exist already?
>>
>> The Action Helper would perform the following:
>> 1. Disable layout
>> 2. Disable view
>> 3. Set appropriate headers
>> 4. Send the file
> 
> ContextSwitch allows you to specify arbitrary callbacks to call
> per-context; I'd simply use it and create a callback that performs these
> tasks.
> 
> -- 
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Action-Helper-To-Send-Files--tp20600931p20608355.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Are folders storing include files still relevant in zend framework

2008-11-20 Thread Julian102

To solve the problem I have done the following please could you let me know
if this is a good way of solving the problem or if there is a better way.



I have created a folder called navigation inside application/view/scripts/.
containg the different navigation templates

I have then added the following line to the predispatch method in the
controller - $this->view->layout()->nav =
$this->view->render('/navigation/nav1.phtml');
 I have then added the line  echo $this->layout()->nav; to the layout


Thank You







Simon Corless wrote:
> 
> You should probably be looking at action and view helpers, of which you
> can store them where you like, either module level or lib level. Read
> about these helpers in the docs and it will soon become clear. They act
> just like includes in order to carry out a task or display certain data.
> 

-- 
View this message in context: 
http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-zend-framework-tp20598742p20605558.html
Sent from the Zend Framework mailing list archive at Nabble.com.


RE: [fw-general] Are folders storing include files still relevant in zend framework

2008-11-20 Thread Simon Corless

You should probably be looking at action and view helpers, of which you can
store them where you like, either module level or lib level. Read about
these helpers in the docs and it will soon become clear. They act just like
includes in order to carry out a task or display certain data.

-
Simon

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-zend-framework-tp20598742p20605061.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_DOM and AJAX

2008-11-20 Thread Matthew Weier O'Phinney
-- edgelogix <[EMAIL PROTECTED]> wrote
(on Wednesday, 19 November 2008, 10:26 PM -0800):
> Thanks alot, for providing such an informative reply. Actually I'm very new
> to ZF, and getting so many problems in finiding any good working example of
> Zend_Dojo in combination with AJAX. Would you please suggest me any good and
> descriptive example which can help a beginner like me to start good hands on
> it. 

I've done a webinar on Dojo/ZF integration that you can find here:

http://www.zend.com/en/resources/webinars/framework

Additionally, I have a Pastebin sample application that demonstrates a
number of the integration points; you can grab it from my github repo:

http://github.com/weierophinney/pastebin


> Matthew Weier O'Phinney-3 wrote:
> > 
> > -- edgelogix <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 18 November 2008, 05:45 AM -0800):
> >> I've just designed the UI for the application, here I got a question
> >> about
> >> the forms. I want to use AJAX and DOM, so what is the recommendations
> >> about
> >> that , how and what is the is most appropriate way to accomplish both of
> >> the
> >> things. I guess Zend_Dom and also kindly let me know is the Dojo right
> >> choice to add here. Thanks
> > 
> > Zend_Dom is simply a way to query DOM structures using either CSS query
> > selectors or XPath. It was developed to aid testing, and is being used
> > by many for screen scraping. It has absolutely no relation to Ajax.
> > 
> > As for Ajax and dynamic user interfaces, the supported solution by Zend
> > Framework is Zend_Dojo; we ship Dojo with the full distribution, and
> > Zend_Dojo provides the means for integrating with it -- via view
> > helpers, Zend_Dojo_Form, Zend_Dojo_Data, and Zend_Json_Server.
> > Additionally, as of yesterday's 1.7.0 release, we now have ZendX_JQuery
> > in the extras package, which provides jquery integration (though we do
> > not ship jquery with ZF).
> > 
> > -- 
> > Matthew Weier O'Phinney
> > Software Architect   | [EMAIL PROTECTED]
> > Zend Framework   | http://framework.zend.com/
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Zend_DOM-and-AJAX-tp20559881p20595780.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

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


Re: [fw-general] Action Helper To Send Files?

2008-11-20 Thread Matthew Weier O'Phinney
-- Sudheer <[EMAIL PROTECTED]> wrote
(on Thursday, 20 November 2008, 06:48 PM +0530):
> I have few questions:
>
> 1. Would it make sense to write a PDF file sender Action Helper for ZF?  
> I was wondering whether we could add this feature to contextSwitch  
> Action Helper.
> 2. Or would it make more sense to write a generic file sender Action  
> Helper with various adapters - PDF, CSV, Text, etc? 3. Does something 
> like this exist already?
>
> The Action Helper would perform the following:
> 1. Disable layout
> 2. Disable view
> 3. Set appropriate headers
> 4. Send the file

ContextSwitch allows you to specify arbitrary callbacks to call
per-context; I'd simply use it and create a callback that performs these
tasks.

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


Re: [fw-general] Zend_Form and square brackets in elements' name

2008-11-20 Thread Julien Huang
On Thu, Nov 13, 2008 at 17:01, Matthew Weier O'Phinney <[EMAIL PROTECTED]> 
wrote:
> You have several options. First, you can declare the element an array:
>
>$element->setIsArray(true);
>
> Second, you can use subforms to group related items -- this will create
> array notation by default.
>
> In your example, declare the MultiCheckbox as an array.

Using setIsArray or subForm doesn't work, my square brackets are still
stripped from the original name, and an empty sets of square brackets
is appended at the element's name.

$e = $f->createElement('multiCheckbox', 'question[42]');
// I've also tried with "question[42][]"
$e->setIsArray(true);
$e->setMultiOptions(array(
'Checkbox 1',
'Checkbox 2',
'Checkbox 3',
));
$f->addElement($e);

If obtain this :


While I want this :


-- 
Julien Huang


RE: [fw-general] Are folders storing include files still relevant in zend framework

2008-11-20 Thread Julian102

Thank you for your reply,

I have read the whole of the quick start section however i don't think it
answers my question. If I have a 5 page website and three of the pages have
a different navigation area to the other two normally I would put all
navigation areas into different include files within an include folder and
just call them when needed. 

I don't know if this is the correct approach using zend framework, in the
quick start section the form is put in applications / forms so prehaps i
could put them in application/navigation but think this could start to get
difficult to maintain.

Thank you in advance


Marco Kaiser-2 wrote:
> 
> Hi Julian,
> 
> you should start here:
> http://framework.zend.com/docs/quickstart
> 
> This explains also how you have to setup Project and the specific
> Directory
> Structure. :-)
> 
> -- Marco Kaiser
> 
> -Original Message-
> From: Julian102 [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 20, 2008 11:52 AM
> To: fw-general@lists.zend.com
> Subject: [fw-general] Are folders storing include files still relevant in
> zend framework
> 
> 
> Hello,
> 
> I am new to zend framework and would like to know how include files are
> used
> in zend.
> 
> Currently I have an includes folder storing my include files in my public
> folder with my css and flash folders etc. I am callling these files from
> layout.phtml etc however I do not feel this is the best way of doing
> things
> as I feel the html should be stored in the view.
> 
> If you could explain a better way of doing things or a link to somewhere
> that explain the situation better I would be very appreciative.
> 
> Thank You
> 
> Julian
> -- 
> View this message in context:
> http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-ze
> nd-framework-tp20598742p20598742.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-zend-framework-tp20598742p20601024.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Action Helper To Send Files?

2008-11-20 Thread Sudheer

Hi All,

I have few questions:

1. Would it make sense to write a PDF file sender Action Helper for ZF? 
I was wondering whether we could add this feature to contextSwitch 
Action Helper.
2. Or would it make more sense to write a generic file sender Action 
Helper with various adapters - PDF, CSV, Text, etc? 
3. Does something like this exist already?


The Action Helper would perform the following:
1. Disable layout
2. Disable view
3. Set appropriate headers
4. Send the file

Regards,
--

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



Re: [fw-general] How to run an action internally

2008-11-20 Thread Matthew Weier O'Phinney
-- eventhough <[EMAIL PROTECTED]> wrote
(on Thursday, 20 November 2008, 02:00 AM -0800):
> If I add an action to the action stack, how do I grab the output from the
> action?
> 
> Where does the output get stored?

By default, it is appended to the response body. However, in the given
action, you can specify a specific response segment to render to; if you
do this, in your layout, you can fetch it by that segment name.

For example, you could have the following in your action:

$this->_helper->viewRenderer->setResponseSegment('foo');

which tells the ViewRenderer to render to the "foo" response segment.

Then in your layout view script, pull it as follows:

$this->layout()->foo;

You can also pull it directly from the response object at any time:

$response->getBody('foo');


> Christian Münch wrote:
> > 
> > 
> >> Hello,
> >>
> >> Is it possible to run an action within an action?
> >>
> >> Let's say I have two controllers each with one action (foo and bar).
> >>
> >> If the user is at controller1/foo and I would like to run controller2/boo
> >> from within foo, how would I do that?
> >>
> >> Do I need to create my own request object and push a new action to the
> >> action stack?
> >>
> >> Thanks!
> >>   
> > 
> > Yes,
> > 
> > you can use the Action Helper "ActionStack". You can find it in the
> > manual.
> > http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.actionstack
> > 
> > Another option is to forward to another action with the _forward()
> > method of the controller action.
> > 
> > 
> > Christian
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-run-an-action-internally-tp20595526p20598067.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

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


RE: [fw-general] Are folders storing include files still relevant in zend framework

2008-11-20 Thread Marco Kaiser
Hi Julian,

you should start here:
http://framework.zend.com/docs/quickstart

This explains also how you have to setup Project and the specific Directory
Structure. :-)

-- Marco Kaiser

-Original Message-
From: Julian102 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 20, 2008 11:52 AM
To: fw-general@lists.zend.com
Subject: [fw-general] Are folders storing include files still relevant in
zend framework


Hello,

I am new to zend framework and would like to know how include files are used
in zend.

Currently I have an includes folder storing my include files in my public
folder with my css and flash folders etc. I am callling these files from
layout.phtml etc however I do not feel this is the best way of doing things
as I feel the html should be stored in the view.

If you could explain a better way of doing things or a link to somewhere
that explain the situation better I would be very appreciative.

Thank You

Julian
-- 
View this message in context:
http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-ze
nd-framework-tp20598742p20598742.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How the heck do you go into production mode?

2008-11-20 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Doing the same here, I usually recognize the production enviroment from
the HTTP_HOST.
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


Julien Pauli schrieb:
> Personnaly, I use some kind of Apache setEnv + php's $_SERVER to push my
> app in prod mode.
> 
> Julien.P
> 
> 2008/11/19 Terre Porter <[EMAIL PROTECTED]
> >
> 
> This would depend on the programmer and the style he/she used.
> 
> For example, I used the zend studio MVC bootstrap/initializer style
> in my
> project.
> 
> You might have something like this in the bootstrap.php in you app dir.
> Could also be in the index.php in the web root, if not using a bootstrap
> file.
> 
> $frontController->registerPlugin(new Initializer('development'));
> 
> All I have to do is change development to production, and I'm out of dev
> mode. But I'd look in the initializer file to make sure, to see if
> it has to
> be something specific.
> 
> Sorry to say, but you'll just have to track it down.
> 
> I'd start looking at the index.php and any configs that are loaded.
> It would
> be in the beginning of the application.
> 
> Terre
> 
> -Original Message-
> From: MrEMan [mailto:[EMAIL PROTECTED] ]
> Sent: Wednesday, November 19, 2008 11:50 AM
> To: fw-general@lists.zend.com 
> Subject: [fw-general] How the heck do you go into production mode?
> 
> 
> I've been developing a Zend app for awhile now. It's a project I adopted
> from a previous contractor and I am not the one responsible for
> deploying
> it.
> I've recently encountered a production bug and really need to run
> the app in
> production mode locally to figure this out.
> 
> How do I run my Zend Framework app in production? It must be obvious,
> because it doesn't seem to be documented _anywhere_.
> 
> Thanks
> --
> View this message in context:
> 
> http://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp2058403
> 1p20584031.html
> 
> 
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkklRy8ACgkQ0HfT5Ws789A5NwCfaMy+fXlqb723oCAK4X4WHUSn
nCcAnjlkfPqFDs7s88/R894w72WZaXWT
=RT6s
-END PGP SIGNATURE-


[fw-general] Are folders storing include files still relevant in zend framework

2008-11-20 Thread Julian102

Hello,

I am new to zend framework and would like to know how include files are used
in zend.

Currently I have an includes folder storing my include files in my public
folder with my css and flash folders etc. I am callling these files from
layout.phtml etc however I do not feel this is the best way of doing things
as I feel the html should be stored in the view.

If you could explain a better way of doing things or a link to somewhere
that explain the situation better I would be very appreciative.

Thank You

Julian
-- 
View this message in context: 
http://www.nabble.com/Are-folders-storing-include-files-still-relevant-in-zend-framework-tp20598742p20598742.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to run an action internally

2008-11-20 Thread eventhough

If I add an action to the action stack, how do I grab the output from the
action?

Where does the output get stored?

Thanks


Christian Münch wrote:
> 
> 
>> Hello,
>>
>> Is it possible to run an action within an action?
>>
>> Let's say I have two controllers each with one action (foo and bar).
>>
>> If the user is at controller1/foo and I would like to run controller2/boo
>> from within foo, how would I do that?
>>
>> Do I need to create my own request object and push a new action to the
>> action stack?
>>
>> Thanks!
>>   
> 
> Yes,
> 
> you can use the Action Helper "ActionStack". You can find it in the
> manual.
> http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.actionstack
> 
> Another option is to forward to another action with the _forward()
> method of the controller action.
> 
> 
> Christian
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-run-an-action-internally-tp20595526p20598067.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to run an action internally

2008-11-20 Thread Christian Münch

> Hello,
>
> Is it possible to run an action within an action?
>
> Let's say I have two controllers each with one action (foo and bar).
>
> If the user is at controller1/foo and I would like to run controller2/boo
> from within foo, how would I do that?
>
> Do I need to create my own request object and push a new action to the
> action stack?
>
> Thanks!
>   

Yes,

you can use the Action Helper "ActionStack". You can find it in the manual.
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.actionstack

Another option is to forward to another action with the _forward()
method of the controller action.


Christian