Re: [fw-general] Overriding Zend_Loader::loadClass()

2008-12-02 Thread Jack Sleight
Hi Everyone,
Just wanted to post a quick update to my previous script, which is now
compatible with 1.7.1 and Zend_Loader_PluginLoader, the code is here:

http://pastebin.com/f19b4676

Place it in a directory, create a subdirectory called "source" and put
a copy of ZF in it. Create a new folder called "target". Run the
script, the modified version will be in "target". You'll notice it
only copies the "library" folder and the root text files, if you need
any of the others you'll have to modify the script or copy them over
manually.

Things it does:

- Comment out all require/include(_once)? "Zend..." lines
- Replace all Zend_Loader::loadClass() calls with spl_autoload_call calls
- Fix require_once calls in Zend_Cache
- Fix require_once calls in Zend_Memory
- Fix Zend_Loader_PluginLoader


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Rolando Espinoza La Fuente
On Tue, Dec 2, 2008 at 3:06 AM, Cameron <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> The subject line sums it all up. I do some URL generation in the controller
> / model (form submission URLs and so on), and I'd love to be able to use the
> same url View Helper that has proven so wonderful in my Views. What's the
> trick? I'm sure it's something simple that I'm not smart enough to have
> guessed.

Have you tried the url action helper?

 $thils->_helper->url($action, $controller);

Cheers,

-- 
Rolando Espinoza La fuente


Re: [fw-general] Strategy for "panels" / "blocks"

2008-12-02 Thread Behzad
Try the following code (From a internal-only Controller):

public function preDispatch()
{
// prevent requesting this controller by URL, only
action-view-helper/ajax calls are allowed
if ($this->getFrontController()->getRequest()->getControllerName()
== $this->getRequest()->getControllerName() &&
$this->getFrontController()->getRequest()->getModuleName() ==
$this->getRequest()->getModuleName() &&
!$this->getRequest()->isXmlHttpRequest()) {
return $this->_helper->forward404();
}
}


On Sun, Nov 30, 2008 at 8:33 PM, Thorsten Ruf <[EMAIL PROTECTED]>wrote:

> The main problem with view action helpers is, you (the user) can access the
> action simply by accessing the appropiate url, too. The access can not be
> restricted in any way. I was looking for a alternative to grant access only
> to "internal" access. Maybe Matthew can say something about handling such a
> requirement?
>
>
> On Sun, Nov 30, 2008 at 17:24, Joó Ádám <[EMAIL PROTECTED]> wrote:
>
>> Check out the action view helper:
>>
>> http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.action
>> You could call it in your layout script.
>>
>>
>> Regards,
>> Ádám
>>
>
>


-- 
Kind regards,
-behzad


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Graham Anderson
On Tuesday 02 December 2008 08:06:52 Cameron wrote:
>Hi guys,
>
>The subject line sums it all up. I do some URL generation in the controller
>/ model (form submission URLs and so on), and I'd love to be able to use the
>same url View Helper that has proven so wonderful in my Views. What's the
>trick? I'm sure it's something simple that I'm not smart enough to have
>guessed.

There's a controller action helper that provides the same functionality, plus 
a little more.

http://framework.zend.com/apidoc/core/Zend_Controller/Zend_Controller_Action_Helper/Zend_Controller_Action_Helper_Url.html


Re: [fw-general] Need help regarding error handling

2008-12-02 Thread amar4kintu

Thanks Matthew,

It works perfectly now. I was not aware of that. It was this simple.


-- 
View this message in context: 
http://www.nabble.com/Need-help-regarding-error-handling-tp20788987p20791003.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Need help regarding error handling

2008-12-02 Thread Matthew Weier O'Phinney
-- amar4kintu <[EMAIL PROTECTED]> wrote
(on Tuesday, 02 December 2008, 01:48 AM -0800):
> Following is my bootstrap code
> 
> $frontController = Zend_Controller_Front::getInstance();
> 
> $frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler());
> $frontController->throwExceptions(true);

The second directive above cancels out the first. If throwExceptions is
on, the ErrorHandler bails early.

> try {
> $frontController->dispatch();
> } catch (Exception $e) {
> 
> echo  $e->getMessage();
> 
> }
> 
> 
> 
> How can I display $e->getMessage() using ErrorController?
> 
> I have already created ErrorController and error.phtml in my default module.
> But I am not getting how to display error messages using ErrorController.
> 
> Can anyone help me regarding this?

There is an example in both the manual and the quickstart. However, as
noted above, enabling throwExceptions cancels the ErrorHandler. Get rid
of that line, and your try/catch block, and you'll see it start to work.

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


[fw-general] Need help regarding error handling

2008-12-02 Thread amar4kintu

Hello

Following is my bootstrap code

$frontController = Zend_Controller_Front::getInstance();

$frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler());
$frontController->throwExceptions(true);
try {
$frontController->dispatch();
} catch (Exception $e) {

echo  $e->getMessage();

}



How can I display $e->getMessage() using ErrorController?

I have already created ErrorController and error.phtml in my default module.
But I am not getting how to display error messages using ErrorController.

Can anyone help me regarding this?
-- 
View this message in context: 
http://www.nabble.com/Need-help-regarding-error-handling-tp20788987p20788987.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Captcha Form Validation

2008-12-02 Thread joeni

Thank you very much, just what I needed. But perhaps you can help me a little
bit out on how to edit those constants. 

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



Re: [fw-general] Calling non-php library

2008-12-02 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Take a look at this wonderful PECL tutorial by Sara Golemon:

http://devzone.zend.com/node/view/id/1021

Ben
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


monk.e.boy schrieb:
> 
> 
> Bin Hu-3 wrote:
>>
>> some other reasons, I want to call an external library written in C++.  
>>
>> Bin
>>
>>
> 
> I thought this is what PECL is http://pecl.php.net/, you compile the c++ as
> a php interface, then call it like a normal function.
> 
> Or compile your c++ as a normal app, then call it using system (I do this
> with Python all the time) read the vars from a DB or command line.
> 
> I use a DB to provide feed back, so a AJAX page pings the DB for a %
> complete.
> 
> monk.e.boy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk0/WkACgkQ0HfT5Ws789AVuwCg06HKst/viziCaOIRKioNFUZd
M1YAnibdKnQubItA7mP4bho8hl+/AsQG
=dsTQ
-END PGP SIGNATURE-


Re: [fw-general] Calling non-php library

2008-12-02 Thread monk.e.boy



Bin Hu-3 wrote:
> 
> 
> some other reasons, I want to call an external library written in C++.  
> 
> Bin
> 
> 

I thought this is what PECL is http://pecl.php.net/, you compile the c++ as
a php interface, then call it like a normal function.

Or compile your c++ as a normal app, then call it using system (I do this
with Python all the time) read the vars from a DB or command line.

I use a DB to provide feed back, so a AJAX page pings the DB for a %
complete.

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/Calling-non-php-library-tp20786028p20788583.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

*MVC police arriving*

Use the url action helper, it works exacly like the url view helper.
Also the view helper may output html-escaped in the future, so you
shouldn't rely on this. And yes, the assembly method may change
completly with 2.0.

$this->_helper->url();

Ben
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


monk.e.boy schrieb:
> 
> 
> Themselves wrote:
>> What's the trick?
>>
> 
> In your controller -> action:
> 
> $tmp = $this->view->url( array( 'controller'=>'moo' ) );
> 
> Try that.
> 
> This kinda breaks the MVC, so be prepared for the MVC police ;-)
> 
> monk.e.boy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk0/KIACgkQ0HfT5Ws789CqngCeKprkbOEoMZa4pCqqebGmB1F5
ZEYAoLz6CyU+ZIg7pvpBdVa4M5Qygr5u
=sw4C
-END PGP SIGNATURE-


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread monk.e.boy



Themselves wrote:
> 
> What's the trick?
> 

In your controller -> action:

$tmp = $this->view->url( array( 'controller'=>'moo' ) );

Try that.

This kinda breaks the MVC, so be prepared for the MVC police ;-)

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/-Dumb-Question--How-do-I-use-the-URL-view-helper-in-my-controllers--tp20787141p20788535.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread keith Pope
I very much doubt that the routers assemble interface will change, if
it does ZF will definitely announce it as a BC breaking change.

2008/12/2 Cameron <[EMAIL PROTECTED]>:
> well i thought about that, and that's a very simple solution (because the
> code in the url helper is very simple), but that internal interface might
> change in later revisions of the framework, so i thought i'd see about doing
> it the "right" way :P
>
> On Tue, Dec 2, 2008 at 5:21 PM, keith Pope <[EMAIL PROTECTED]> wrote:
>>
>> I would have a look inside the view url helper and maybe create an
>> action helper that does the same?
>>
>> 2008/12/2 Cameron <[EMAIL PROTECTED]>:
>> > Hi guys,
>> >
>> > The subject line sums it all up. I do some URL generation in the
>> > controller
>> > / model (form submission URLs and so on), and I'd love to be able to use
>> > the
>> > same url View Helper that has proven so wonderful in my Views. What's
>> > the
>> > trick? I'm sure it's something simple that I'm not smart enough to have
>> > guessed.
>> >
>>
>>
>>
>> --
>> --
>> [MuTe]
>> --
>
>



-- 
--
[MuTe]
--


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread Cameron
well i thought about that, and that's a very simple solution (because the
code in the url helper is very simple), but that internal interface might
change in later revisions of the framework, so i thought i'd see about doing
it the "right" way :P

On Tue, Dec 2, 2008 at 5:21 PM, keith Pope <[EMAIL PROTECTED]> wrote:

> I would have a look inside the view url helper and maybe create an
> action helper that does the same?
>
> 2008/12/2 Cameron <[EMAIL PROTECTED]>:
> > Hi guys,
> >
> > The subject line sums it all up. I do some URL generation in the
> controller
> > / model (form submission URLs and so on), and I'd love to be able to use
> the
> > same url View Helper that has proven so wonderful in my Views. What's the
> > trick? I'm sure it's something simple that I'm not smart enough to have
> > guessed.
> >
>
>
>
> --
> --
> [MuTe]
> --
>


Re: [fw-general] [Dumb Question] How do I use the URL view helper in my controllers?

2008-12-02 Thread keith Pope
I would have a look inside the view url helper and maybe create an
action helper that does the same?

2008/12/2 Cameron <[EMAIL PROTECTED]>:
> Hi guys,
>
> The subject line sums it all up. I do some URL generation in the controller
> / model (form submission URLs and so on), and I'd love to be able to use the
> same url View Helper that has proven so wonderful in my Views. What's the
> trick? I'm sure it's something simple that I'm not smart enough to have
> guessed.
>



-- 
--
[MuTe]
--