Re: [fw-general] Default Module - Bootstrapping and Models

2009-06-26 Thread Brenton Alker
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Vince42 wrote:
> That's exactly why I am currently trying to port the guestbook example
> to a modularized version - maybe I'll post about it, when it's done. :)

Sounds like a good idea :) I've posted about how I modularized the
guestbook application from quickstart.

http://blog.tekerson.com/2009/06/17/building-a-modular-application-in-zend-framework-part-1/
http://blog.tekerson.com/2009/06/27/building-a-modular-application-in-zend-framework-part-2/

I've also included a github repository with the complete application.

Feedback appreciated.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpFrc0ACgkQ7bkAtAithuvQogCbBBL1QtsCvb82sVxoVe7bMEuN
f+YAoMTRDIrUOTVNl9nvfXuls1LqTf31
=w93K
-END PGP SIGNATURE-


Re: [fw-general] Coping with Old-style GET vars.

2009-06-26 Thread drm

Hi,

You might want to look for the QSA (Query-string append) parameter to 
RewriteRule in mod_rewrite. Refer to the apache docs for this.


Gerard

Matt Pearson wrote:

Hi everyone,

I have a problem with GET forms submitting to controllers within the
framework.

I have a GET form in a page outside of the Zend Framework app. It does a
normal GET to the search controller of my Framework app like this (I
have a custom route set up)

/app/search?q=query

However, my search controller can't get a value for 'q' and the custom
routes all seem to strip off the portion of the url after the '?' !

How do I get routes like Zend_Controller_Router_Route_Regex to use the
portion after the '?'

I have tried disabling all my routes and using the 'real' Framework
path. This works:

/app/search/index/results?q=query

But then I have the problem that my Zend Paginator links become things
like:

 /app/search/index/results/page/1

Which doesn't work, because it omits the search query.

When URIs are in /proper/framework/format everything is fine. I've seen
people use Javascript to get around this problem, but I don't want to
make my site Javascript dependent.

Can anyone help? I'm sure there is something obvious that I'm doing
wrong.

For full disclosure; here are my Apache rules:

RewriteCond %{REQUEST_FILENAME} !-f[OR]
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule ^/app/(.*) /app.php?$1 [L]


(My front controller defines /app as the BaseUrl)

Thanks


Matt Pearson 
Internet Solutions Developer

Liz Earle Beauty Co.
01983 813884



Work with the environment... think before you print

Liz Earle Naturally Active Skincare 
The Green House  Ryde IOW  PO33 1BD


Telephone +44 (0)1983 813913. Fax +44 (0)1983 813912. 
Email naturallyact...@lizearle.com   Web www.lizearle.com  
Liz Earle Naturally Active Skincare is a trading name of Liz Earle Beauty Co. Limited.

Registered in England No. 3070395 Registered address: 5 Fleet Place, London,  
EC4M 7RD.

  




Re: [fw-general] Controller not being found

2009-06-26 Thread drm

Hi Rod,


You most probably do have MultiViews enabled, but not mod_rewrite. 
MultiViews lets files without their extension handle response (e.g. 
index => index.php). Try making simple test cases in your .htaccess to 
figure out if mod_rewrite actually works, e.g.:


RewriteRule .* http://www.zend.com [R,L] # lets every request redirect 
to www.zend.com


If it doesn't, figure out why (look in your apache conf file to see if 
the appropriate LoadModule isn't commented out, for instance).



Gerard



rodp wrote:
Hi, 


I have a problem that I can't figure out and hope someone could help me out.
I've built a fairly simple application that works perfectly fine on my
machine (windows XP running WAMP). 
When I copied it onto a virtual machine running ubuntu 8 and tried to run

the application, I can only get to the IndexController and all its actions,
however I get a "Page not found", and not from the frameworks
ErrorController, more like something wrong with apache's mod_rewrites, when
I try any of the other controllers.

For example:
these links would work:
site.com
site.com/index
site.com/index/someaction
site.com/index/someaction/var/2

these won't
site.com/othercontroller
site.com/othercontroller/someaction

has anyone ever had this problem?

  




Re: [fw-general] Re: Re[fw-general] gistration Form outside controllers

2009-06-26 Thread drm
As Mark is inherently suggesting (I think), you should keep your 
javascript logic as decoupled from your back end as you can. Try and 
make the problems simple chunks you can figure out:


- Can I render a form in a header?
- Can I post this form and validate it?
- Can I let the right model do the appropriate action if the form validates?
-- if you get this far, you have a working prototype. Now the front end 
comes into play
- Can I post a arbitrary form to the server, using and XHR? (with or 
without jquery is your choice of course)

- Can I get the results of this form into whatever html element i want?
- Can I interpret these results correctly to take appropriate action on 
the client side?


And of course putting all together. Just some hints to keep in mind when 
cracking these problems.



Gerard

lightflowmark wrote:

Generally, you would instantiate the form in the controller, and then pass it
to the view script:
Controller.php
myAction()
{
  $form  = new form();
  $this->view->form = $forml
}

I personally would have the dialog open a URL directly, rather than pass it
content to render, but there's probably not much in it.

After that, if I've understood you correctly, you need to submit the form
via an XHR post; then display the results (errors or success) in the dialog
using Javascript.  You would submit the form to a controller action.

I'm not familiar with jQuery, but there should be plenty of sample code
online to do this - it's a common use case.

If this isn't what you mean, post or link to some code

Yours,
Mark




Escape-Artist wrote:
  

Thanks.
Well what I have is a Zend_Form class, so the code for the form is not in
the header.
In the header I instanciate the form. But the code for the validation will
be in the header ( if I stick to this design ).
I like your idea of putting it all in a controller.
But will that work in my case?
The header.phtml opens a jquery dialog, with the instance of my Zend_Form
inside.
I don't know if it's the right structure or not.
Also, I'd like to be able to validate the form without closing this jquery
dialog ( so Ajax obviously ) but I'm not quite sure how to do that exactly
in this case, since the form is in a dialog in a layout, not in a
controller-action...



lightflowmark wrote:


Hi - not sure I understand exactly what you're doing, but here are some
ideas that may help:

1) have the dialog open a URL (registerController/registerForm/) rather
than put the form code into header.phtml.

2) pull the content of registerController/registerForm/ using Xhr and
then writing it to your dialog, if your dialog widget won't take URLs
natively.

3) use a view helper in header.phtml -
$this->view->getRegisterFormForDialog();
The view helper would then instantiate the form object, initialise &
display it.


Not sure if any of that illuminates!

M



Escape-Artist wrote:
  
Hello everyone, this is my first post here. 
I just started my first project with the Zend Framework ( 1.8 ), so I'm
still trying to wrap my head around all the concepts. 
Ok so I set up the basic structure of my site, with two modules: the

default one ( called front ) and another one called admin.
In my front module I only have two controllers so far: index and error.
I created a layout.phtml that loads the main content, and I've also
added some more layout files: headsetup.phtml ( that sets up the head
part of the html file ), header.phtml and footer.phtml.
Now here's my problem/question:
On my site header ( that stays the same throughout the whole site ) I
have a register button, that when clicked on opens a dialog with the
registration form.
So I'm sure there are a lot of different ways to go for here, but what I
did is create a class that extends Zend_Form. In my header.phtml I added
some code to create a jQuery dialog, that opens when the register button
is clicked ( with an overlay in the background ), and this dialog has an
instance of the Zend_Form.
So far it all works fine. But my concern is with the structure. The
whole point of the framwork is to break everything down to separate
logic, layout and so on.
Here, since this register dialog appears when clicked on a button from
the header, i can't use a controller - action - view system, can I?
Because this register dialog is independant of the rest of the site, it
can be opened from anywhere.
So what should I do? What is the best way to go here? I can put all my
code in header.phtml, which at the moment is working fine ( only got to
the part where the jquery dialog with the register form displays when
button is clicked. I haven't tackled validation and that's where it
might get messy inside the layout class, header.phtml ). But obviously
it'd  be better to break this code down like the controller-action-view
system.
Thanks in advance!


  



  




[fw-general] isDefaultTableAdapter and Zend_Db_Table_Abstract

2009-06-26 Thread Terre Porter

Hey all,

I seem to not be able to get the default table adapter to load when
accessing my dbtable class.

A added the line in my config, "resources.db.isDefaultTableAdapter = true".

I'm using this,
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table,
just the dbtable related stuff.

I took the following classes and added them in to my setup. (names adjusted
for the path changes) 

class Models_DbTable_Guestbook extends Zend_Db_Table_Abstract
class Models_GuestbookMapper
class Models_Guestbook

They are loading but I always get the error, "No adapter found for
Models_DbTable_Guestbook"

Was there something else I needed to do other than the
"resources.db.isDefaultTableAdapter = true" in the ini in order to use the
db adapter?

I'm using ZF version 1.8.

Thank
Terre



[fw-general] Zend_Db and very strange problem with executing bulk insert query

2009-06-26 Thread umpirsky

Hi zf gurus.

I have large amount of data which I'm inserting into MySQL db. That is array
of urls and I'm iterating and manually hammering bulk insert qury for better
performances.

So, Im running query with 

$zdb->query('INSERT INTO `Content` (`FeedId`, `ContentValue`) VALUES (..),
(..)');

This works perfect on my Win XP maxhine, but on Cent OS server I get:

exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY093]:
Invalid parameter number: no parameters were bound' in
/var/www/ct1097024.mywebfilter.de/include/library/Zend/Db/Statement/Pdo.php:238
Stack trace:
#0
/var/www/ct1097024.mywebfilter.de/include/library/Zend/Db/Statement.php(283):
Zend_Db_Statement_Pdo->_execute(Array)
#1
/var/www/ct1097024.mywebfilter.de/include/library/Zend/Db/Adapter/Abstract.php(467):
Zend_Db_Statement->execute(Array)
#2
/var/www/ct1097024.mywebfilter.de/include/library/Zend/Db/Adapter/Pdo/Abstract.php(235):
Zend_Db_Adapter_Abstract->query('INSERT INTO `Co...', Array)
#3
/var/www/ct1097024.mywebfilter.de/include/application/models/Content.php(89):
Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `Co...')
#4 /var/www/ct1097024.mywebfilter.de/include/library/Umpirsky/Feed.php(66):
Default_Model_Content->insertBulkExecute()
#5
/var/www/ct1097024.mywebfilter.de/include/library/Umpirsky/Feed/Phishtank.php(45):
Umpirsky_Feed->import(Array, true)
#6
/var/www/ct1097024.mywebfilter.de/include/library/Umpirsky/Feed/Abstract.php(50):
Umpirsky_Feed_Phishtank->sync(Array)
#7 /var/www/ct1097024.mywebfilter.de/include/crons/feed.php(66):
Umpirsky_Feed_Abstract->update()
#8 {main}

Strange think is also that I have several sorts of feeds and it works for
some other which have only domain names or md5 URLs, so I assume thats some
invalid chars problem. I alse prepare query like this:

$this->insertValues .= '(' . $feedId . ',' . 
$this->getAdapter()->quote($contentValue) . '),';

for each link.

Also I tries to dump executed query on failure:

INSERT INTO `Content` (`FeedId`, `ContentValue`) VALUES
(1,'http://211.86.85.166/new/skin/tb/readme.html'),(1,'http://www.octense.de//files/tmp_/tinymce/jscripts/tiny_mce/www.irs.gov/refund/0,,id=181665,00.html'),
...  ...
(1,'http://209.50.252.96/camera/beta4.html?forward.to.friends.login:http://login.myspace.com/index.cfm?fuseaction')

Query is so long that Notepad++ cannot completely display it, it contains
8681 URLs.

Any idea?

Regards,
Saša Stamenković.
-- 
View this message in context: 
http://www.nabble.com/Zend_Db-and-very-strange-problem-with-executing-bulk-insert-query-tp24226472p24226472.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Default Module - Bootstrapping and Models

2009-06-26 Thread keith Pope
2009/6/26 Vince42 :
> Hi,
>
> swilhelm schrieb:
>> I agree, modules (and auth and acl) should be added to the QuickStart
>> or some other Zend provided example. I can't think of any real world
>> application that will not need these three additional capabilities.
>
> That's exactly why I am currently trying to port the guestbook example
> to a modularized version - maybe I'll post about it, when it's done. :)

If you are interested in examples using modules, acl, caching, auth,
testing etc I have a sample storefront on google code:

http://code.google.com/p/zendframeworkstorefront/

The code is pretty much complete now, though I will be adding bits
later on I hope.

>
> --
> Cheers,                        \\|//
> Vince                          (o o)
> ooO-(_)-Ooo-
>  '''   (o)_(o)                                        [ ][0][ ]
>  ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
>  -    (")_(")                                        [0][0][0]
>
>  ()  ascii ribbon campaign - against html e-mail
>  /\  www.asciiribbon.org   - against proprietary attachments
>                                   Ooo.
> ---.ooO(  )-
>                           (  )    (_/
>                            \_)
>
>



-- 
--
[MuTe]
--


[fw-general] Zend Dojo SubForm Filtering Select Issue

2009-06-26 Thread adbluegene

Hi,

I have multiple filtering selects in my Dojo form (they work just fine). But
when I create a subform and add filtering select to it, none of the
filtering select function (even in the parent form fail to function). I have
made sure that I am using unique IDs for filtering select. I populate
filtering select using a text file.

Any pointers would be great.

Thanks,
Abhi
-- 
View this message in context: 
http://www.nabble.com/Zend-Dojo-SubForm-Filtering-Select-Issue-tp24223979p24223979.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Default Module - Bootstrapping and Models

2009-06-26 Thread Vince42
Hi,

swilhelm schrieb:
> I agree, modules (and auth and acl) should be added to the QuickStart
> or some other Zend provided example. I can't think of any real world
> application that will not need these three additional capabilities.

That's exactly why I am currently trying to port the guestbook example
to a modularized version - maybe I'll post about it, when it's done. :)

-- 
Cheers,\\|//
Vince  (o o)
ooO-(_)-Ooo-
 '''   (o)_(o)[ ][0][ ]
 ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
  -(")_(")[0][0][0]

 ()  ascii ribbon campaign - against html e-mail
 /\  www.asciiribbon.org   - against proprietary attachments
   Ooo.
---.ooO(  )-
   (  )(_/
\_)



signature.asc
Description: OpenPGP digital signature


Re: [fw-general] Default Module - Bootstrapping and Models

2009-06-26 Thread Vince42
Hi,

keith Pope schrieb:
> I find it best to name the default module though
> like this:
> 
> resources.frontcontroller.defaultmodule = "mynamespace"
> resources.frontcontroller.params.prefixDefaultModule = true
> 
> and then use:
> 
> $this->_resourceLoader = new Zend_Application_Module_Autoloader(array(
> 'namespace' => 'Mynamespace',
> 'basePath'  => APPLICATION_PATH . '/modules/mynamespace',
> ));
> 
> This way all your modules are properly namespaced so you can use them
> in other projects etc.

This seems to work without specifying prefixDefaultModule as true ...

Besides this working solution it would be more logical that a plain
Bootstrap.php in the default directory takes care of the autoloading as
it does for non-default modules, because these lines of code are simply
superfluous if not irritating.

-- 
Cheers,\\|//
Vince  (o o)
ooO-(_)-Ooo-
 '''   (o)_(o)[ ][0][ ]
 ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
  -(")_(")[0][0][0]

 ()  ascii ribbon campaign - against html e-mail
 /\  www.asciiribbon.org   - against proprietary attachments
   Ooo.
---.ooO(  )-
   (  )(_/
\_)



signature.asc
Description: OpenPGP digital signature


Re: [fw-general] Default Module - Bootstrapping and Models

2009-06-26 Thread swilhelm

I agree, modules (and auth and acl) should be added to the QuickStart or some
other Zend provided example. I can't think of any real world application
that will not need these three additional capabilities.

- Steve W.


Vince42 wrote:
> 
> Hi,
> 
> Dalibor Karlović schrieb:
>> I think we should rethink this as it's obvious many people use the
>> default module just like any other so the behavior should be as
>> expected, even if adding an additional option.
> 
> I circumvented this odd behaviour with
> 
>http://paste2.org/p/284720
> 
> but I think that this is ugly and - if not provided otherwise - ZF
> should treat the default module exactly as you described it and
> everybody would expect it to work.
> 
> Unfortunately the Quickstart is omitting the module topic - and I really
> think that the module approach should be enforced as it leaves much more
> room for flexibility, self-contained / autarchic modules etc ... just my
> two cents. :)
> 
> -- 
> Cheers,\\|//
> Vince  (o o)
> ooO-(_)-Ooo-
>  '''   (o)_(o)[ ][0][ ]
>  ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
>   -(")_(")[0][0][0]
> 
>  ()  ascii ribbon campaign - against html e-mail
>  /\  www.asciiribbon.org   - against proprietary attachments
>Ooo.
> ---.ooO(  )-
>(  )(_/
> \_)
> 
> 
>  
> 

-- 
View this message in context: 
http://www.nabble.com/Default-Module---Bootstrapping-and-Models-tp24211701p24222781.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] session not workin

2009-06-26 Thread Tom Shaw
Try using phpmyadmin and make sure your data types are correct. I have mine
set to

Id varchar 32
modified int 11
lifetime int 11
data text

Tom

-Original Message-
From: KimG [mailto:kim.gabriel...@get2net.dk] 
Sent: Friday, June 26, 2009 7:31 AM
To: fw-general@lists.zend.com
Subject: [fw-general] session not workin


Hi,

i have some great problems getting Zend::session to work.

i started out with the simple usage of Zend::session but it doesn't work.

so i decided to use a database as a backend instead.

i have the following in my bootstrap (taken directly from the zend docs):

$db = Zend_Db::factory('Pdo_Mysql', array(
'host'=>'localhost',
'username'=> 'abc,
'password'=> 'def',
'dbname'=> 'mybase'
));

$config = array(
'name'   => 'session',
'primary'=> 'id',
'modifiedColumn' => 'modified',
'dataColumn' => 'data',
'lifetimeColumn' => 'lifetime',
'db' => $db
);
Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config));
Zend_Session::start();


when i point my browser at the index link i get the page but a warning is
dispalyed too:

Warning: session_write_close() [function.session-write-close]: Failed to
write session data (user). Please verify that the current setting of
session.save_path is correct (/var/lib/php/session) in
/usr/share/Zend/library/Zend/Session.php on line 651


what does it mean and how can i aleviate it? nothing is inserted into the
database table.

i now the db setup is correct so that's not the reason.

kim
-- 
View this message in context:
http://www.nabble.com/session-not-workin-tp24219498p24219498.html
Sent from the Zend Framework mailing list archive at Nabble.com.




[fw-general] session not workin

2009-06-26 Thread KimG

Hi,

i have some great problems getting Zend::session to work.

i started out with the simple usage of Zend::session but it doesn't work.

so i decided to use a database as a backend instead.

i have the following in my bootstrap (taken directly from the zend docs):

$db = Zend_Db::factory('Pdo_Mysql', array(
'host'=>'localhost',
'username'=> 'abc,
'password'=> 'def',
'dbname'=> 'mybase'
));

$config = array(
'name'   => 'session',
'primary'=> 'id',
'modifiedColumn' => 'modified',
'dataColumn' => 'data',
'lifetimeColumn' => 'lifetime',
'db' => $db
);
Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config));
Zend_Session::start();


when i point my browser at the index link i get the page but a warning is
dispalyed too:

Warning: session_write_close() [function.session-write-close]: Failed to
write session data (user). Please verify that the current setting of
session.save_path is correct (/var/lib/php/session) in
/usr/share/Zend/library/Zend/Session.php on line 651


what does it mean and how can i aleviate it? nothing is inserted into the
database table.

i now the db setup is correct so that's not the reason.

kim
-- 
View this message in context: 
http://www.nabble.com/session-not-workin-tp24219498p24219498.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Coping with Old-style GET vars.

2009-06-26 Thread Matthew Weier O'Phinney
-- Matt Pearson  wrote
(on Friday, 26 June 2009, 12:36 PM +0100):
> I have a problem with GET forms submitting to controllers within the
> framework.
> 
> I have a GET form in a page outside of the Zend Framework app. It does a
> normal GET to the search controller of my Framework app like this (I
> have a custom route set up)
> 
> /app/search?q=query
> 
> However, my search controller can't get a value for 'q' and the custom
> routes all seem to strip off the portion of the url after the '?' !

Within your controller, you have a couple of different ways to retrieve
this value:

  * via _getParam: $this->_getParam('q'). This actually proxies to the
request object's getParam() method, which searches first for
parameters matched on the route, then GET, then POST.

  * via the request object's getQuery() method:
$this->getRequest()->getQuery('q');

> How do I get routes like Zend_Controller_Router_Route_Regex to use the
> portion after the '?'

You don't. You'll have to do one of two things:

  * Extend the Regex route to merge $_GET parameters into the array of
matched parameters

  * Create a RewriteCond to match the query string and rewrite the URL:

RewriteCond %{query_string} ^q=([^&]*)$
RewriteRule ^/?app/search  /app/search/q/%1

Note that I haven't tested the above, but the idea is that it
searches for a "q" parameter in URLs with /app/search, and then
rewrites the url to add it into the URL itself.


> I have tried disabling all my routes and using the 'real' Framework
> path. This works:
> 
> /app/search/index/results?q=query
> 
> But then I have the problem that my Zend Paginator links become things
> like:
> 
>  /app/search/index/results/page/1
> 
> Which doesn't work, because it omits the search query.
> 
> When URIs are in /proper/framework/format everything is fine. I've seen
> people use Javascript to get around this problem, but I don't want to
> make my site Javascript dependent.
> 
> Can anyone help? I'm sure there is something obvious that I'm doing
> wrong.
> 
> For full disclosure; here are my Apache rules:
> 
> RewriteCond %{REQUEST_FILENAME} !-f[OR]
> RewriteCond %{REQUEST_FILENAME} !-d
>  
> RewriteRule ^/app/(.*) /app.php?$1 [L]
> 
> (My front controller defines /app as the BaseUrl)

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


[fw-general] Coping with Old-style GET vars.

2009-06-26 Thread Matt Pearson
Hi everyone,

I have a problem with GET forms submitting to controllers within the
framework.

I have a GET form in a page outside of the Zend Framework app. It does a
normal GET to the search controller of my Framework app like this (I
have a custom route set up)

/app/search?q=query

However, my search controller can't get a value for 'q' and the custom
routes all seem to strip off the portion of the url after the '?' !

How do I get routes like Zend_Controller_Router_Route_Regex to use the
portion after the '?'

I have tried disabling all my routes and using the 'real' Framework
path. This works:

/app/search/index/results?q=query

But then I have the problem that my Zend Paginator links become things
like:

 /app/search/index/results/page/1

Which doesn't work, because it omits the search query.

When URIs are in /proper/framework/format everything is fine. I've seen
people use Javascript to get around this problem, but I don't want to
make my site Javascript dependent.

Can anyone help? I'm sure there is something obvious that I'm doing
wrong.

For full disclosure; here are my Apache rules:

RewriteCond %{REQUEST_FILENAME} !-f[OR]
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule ^/app/(.*) /app.php?$1 [L]

(My front controller defines /app as the BaseUrl)

Thanks


Matt Pearson 
Internet Solutions Developer
Liz Earle Beauty Co.
01983 813884



Work with the environment... think before you print

Liz Earle Naturally Active Skincare 
The Green House  Ryde IOW  PO33 1BD

Telephone +44 (0)1983 813913. Fax +44 (0)1983 813912. 
Email naturallyact...@lizearle.com   Web 
www.lizearle.com  
Liz Earle Naturally Active Skincare is a trading name of Liz Earle Beauty Co. 
Limited.
Registered in England No. 3070395 Registered address: 5 Fleet Place, London,  
EC4M 7RD.


[fw-general] Controller not being found

2009-06-26 Thread rodp

Hi, 

I have a problem that I can't figure out and hope someone could help me out.
I've built a fairly simple application that works perfectly fine on my
machine (windows XP running WAMP). 
When I copied it onto a virtual machine running ubuntu 8 and tried to run
the application, I can only get to the IndexController and all its actions,
however I get a "Page not found", and not from the frameworks
ErrorController, more like something wrong with apache's mod_rewrites, when
I try any of the other controllers.

For example:
these links would work:
site.com
site.com/index
site.com/index/someaction
site.com/index/someaction/var/2

these won't
site.com/othercontroller
site.com/othercontroller/someaction

has anyone ever had this problem?

-- 
View this message in context: 
http://www.nabble.com/Controller-not-being-found-tp24217253p24217253.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Re: Re[fw-general] gistration Form outside controllers

2009-06-26 Thread lightflowmark

Generally, you would instantiate the form in the controller, and then pass it
to the view script:
Controller.php
myAction()
{
  $form  = new form();
  $this->view->form = $forml
}

I personally would have the dialog open a URL directly, rather than pass it
content to render, but there's probably not much in it.

After that, if I've understood you correctly, you need to submit the form
via an XHR post; then display the results (errors or success) in the dialog
using Javascript.  You would submit the form to a controller action.

I'm not familiar with jQuery, but there should be plenty of sample code
online to do this - it's a common use case.

If this isn't what you mean, post or link to some code

Yours,
Mark




Escape-Artist wrote:
> 
> Thanks.
> Well what I have is a Zend_Form class, so the code for the form is not in
> the header.
> In the header I instanciate the form. But the code for the validation will
> be in the header ( if I stick to this design ).
> I like your idea of putting it all in a controller.
> But will that work in my case?
> The header.phtml opens a jquery dialog, with the instance of my Zend_Form
> inside.
> I don't know if it's the right structure or not.
> Also, I'd like to be able to validate the form without closing this jquery
> dialog ( so Ajax obviously ) but I'm not quite sure how to do that exactly
> in this case, since the form is in a dialog in a layout, not in a
> controller-action...
> 
> 
> 
> lightflowmark wrote:
>> 
>> Hi - not sure I understand exactly what you're doing, but here are some
>> ideas that may help:
>> 
>> 1) have the dialog open a URL (registerController/registerForm/) rather
>> than put the form code into header.phtml.
>> 
>> 2) pull the content of registerController/registerForm/ using Xhr and
>> then writing it to your dialog, if your dialog widget won't take URLs
>> natively.
>> 
>> 3) use a view helper in header.phtml -
>> $this->view->getRegisterFormForDialog();
>> The view helper would then instantiate the form object, initialise &
>> display it.
>> 
>> 
>> Not sure if any of that illuminates!
>> 
>> M
>> 
>> 
>> 
>> Escape-Artist wrote:
>>> 
>>> Hello everyone, this is my first post here. 
>>> I just started my first project with the Zend Framework ( 1.8 ), so I'm
>>> still trying to wrap my head around all the concepts. 
>>> Ok so I set up the basic structure of my site, with two modules: the
>>> default one ( called front ) and another one called admin.
>>> In my front module I only have two controllers so far: index and error.
>>> I created a layout.phtml that loads the main content, and I've also
>>> added some more layout files: headsetup.phtml ( that sets up the head
>>> part of the html file ), header.phtml and footer.phtml.
>>> Now here's my problem/question:
>>> On my site header ( that stays the same throughout the whole site ) I
>>> have a register button, that when clicked on opens a dialog with the
>>> registration form.
>>> So I'm sure there are a lot of different ways to go for here, but what I
>>> did is create a class that extends Zend_Form. In my header.phtml I added
>>> some code to create a jQuery dialog, that opens when the register button
>>> is clicked ( with an overlay in the background ), and this dialog has an
>>> instance of the Zend_Form.
>>> So far it all works fine. But my concern is with the structure. The
>>> whole point of the framwork is to break everything down to separate
>>> logic, layout and so on.
>>> Here, since this register dialog appears when clicked on a button from
>>> the header, i can't use a controller - action - view system, can I?
>>> Because this register dialog is independant of the rest of the site, it
>>> can be opened from anywhere.
>>> So what should I do? What is the best way to go here? I can put all my
>>> code in header.phtml, which at the moment is working fine ( only got to
>>> the part where the jquery dialog with the register form displays when
>>> button is clicked. I haven't tackled validation and that's where it
>>> might get messy inside the layout class, header.phtml ). But obviously
>>> it'd  be better to break this code down like the controller-action-view
>>> system.
>>> Thanks in advance!
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Registration-Form-outside-controllers-tp24175850p24217121.html
Sent from the Zend Framework mailing list archive at Nabble.com.