RE: [fw-general] Multiple Controller Directories
You may look at using an initialization plugin to do your bootstrapping, this brings all your bootstrap code into a front controller plugin (into a class) which gives you more flexibility. Then you could set the controllers inside there based on the sub domain, or you could have 2 different initialization plugins. Matthew has put an example in the docs http://framework.zend.com/manual/en/zend.test.phpunit.html#zend.test.phpunit.bootstrapping I find using this technique give you more control over the bootstrap process. Keith Pope Web Developer -Original Message- From: maxarbos [mailto:[EMAIL PROTECTED] Sent: 07 August 2008 22:12 To: fw-general@lists.zend.com Subject: [fw-general] Multiple Controller Directories Hello, I want to know if it is possible to have multiple controller directories without having to use the module name in the url? What I am looking to do is have sub1.domain.com point to /application/sub1 and sub2.domain.com point to /application/sub2 within the /application dir, there is one main dir (the default one, named: commonground) that runs the ACL and custom conrollers. So the dir structire looks like this: /application --/commonground /controllers --/AclController.php --/sub1 /controllers --/HelloController.php --/sub2 /controllers --/SecretController.php I want to call one bootstrap with all subX.domains.com and have the --/commonground dir process stuff like the ACL, but then when sub2.domain.com/secret is called, it checks in the /commonground first and then into the /sub2 dir. I tried addControllerDirectory but without a module name, it overwrites the default controller dir. I dont want to use sub2.domain.com/sub2/secret but instead want the subdomain to control which dir it has access to. I am doing this by SEVER_NAME. Any advice would be great, thanks. -- View this message in context: http://www.nabble.com/Multiple-Controller-Directories-tp18879750p18879750.html Sent from the Zend Framework mailing list archive at Nabble.com. -- allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, Hereford, HR1 3SE. Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88. Telephone: 0870 243 3434, Fax: 0870 243 6041. Website: www.allpay.net Email: [EMAIL PROTECTED] This email, and any files transmitted with it, is confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this email in error please notify the allpay.net Information Security Manager at the number above.
RE: [fw-general] Multiple Controller Directories
Sorry I didnt read your email fully, its early :) You could try using the router to eliminate the modules problem you have, checkout the docs http://framework.zend.com/manual/en/zend.controller.router.html section 7.5.6.1.3. Hostname routing Keith Pope Web Developer -Original Message- From: Keith Pope Sent: 08 August 2008 08:11 To: fw-general; maxarbos Subject: RE: [fw-general] Multiple Controller Directories You may look at using an initialization plugin to do your bootstrapping, this brings all your bootstrap code into a front controller plugin (into a class) which gives you more flexibility. Then you could set the controllers inside there based on the sub domain, or you could have 2 different initialization plugins. Matthew has put an example in the docs http://framework.zend.com/manual/en/zend.test.phpunit.html#zend.test.phpunit.bootstrapping I find using this technique give you more control over the bootstrap process. Keith Pope Web Developer -Original Message- From: maxarbos [mailto:[EMAIL PROTECTED] Sent: 07 August 2008 22:12 To: fw-general@lists.zend.com Subject: [fw-general] Multiple Controller Directories Hello, I want to know if it is possible to have multiple controller directories without having to use the module name in the url? What I am looking to do is have sub1.domain.com point to /application/sub1 and sub2.domain.com point to /application/sub2 within the /application dir, there is one main dir (the default one, named: commonground) that runs the ACL and custom conrollers. So the dir structire looks like this: /application --/commonground /controllers --/AclController.php --/sub1 /controllers --/HelloController.php --/sub2 /controllers --/SecretController.php I want to call one bootstrap with all subX.domains.com and have the --/commonground dir process stuff like the ACL, but then when sub2.domain.com/secret is called, it checks in the /commonground first and then into the /sub2 dir. I tried addControllerDirectory but without a module name, it overwrites the default controller dir. I dont want to use sub2.domain.com/sub2/secret but instead want the subdomain to control which dir it has access to. I am doing this by SEVER_NAME. Any advice would be great, thanks. -- View this message in context: http://www.nabble.com/Multiple-Controller-Directories-tp18879750p18879750.html Sent from the Zend Framework mailing list archive at Nabble.com. -- allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, Hereford, HR1 3SE. Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88. Telephone: 0870 243 3434, Fax: 0870 243 6041. Website: www.allpay.net Email: [EMAIL PROTECTED] This email, and any files transmitted with it, is confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this email in error please notify the allpay.net Information Security Manager at the number above. -- allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, Hereford, HR1 3SE. Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88. Telephone: 0870 243 3434, Fax: 0870 243 6041. Website: www.allpay.net Email: [EMAIL PROTECTED] This email, and any files transmitted with it, is confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this email in error please notify the allpay.net Information Security Manager at the number above.
Re: [fw-general] Context Dependent Menus
You should use the named segments of the Response Object. In your main action, you use the action stack to render multiple actions: $this-_helper-actionStack('menuaction', 'menucontroller', 'default', array(params)); then in MenuController::menuAction you call: $this-getHelper(ViewRenderer)-setNoRender(); $this-getResponse()-appendBody($view-render('foo/bar.phtml'), 'menu1'); The response is then not appended to the Main Content but to another named segment called 'menu1' in your layout.phtml you can then echo this named segment with: ?= $this-layout()-menu1; ? hope it helps. On Friday 08 August 2008 07:42:26 Greg Freeman wrote: What is the best way to create context dependent menu's etc in ZF? Does ZF have anything similar to slots or component slots such as those available in symfony? Thanks -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Context Dependent Menus
Thanks, I believe $this-_helper-viewRenderer-setResponseSegment('menu1'); in the menu action would be simpler though. beberlei wrote: You should use the named segments of the Response Object. In your main action, you use the action stack to render multiple actions: $this-_helper-actionStack('menuaction', 'menucontroller', 'default', array(params)); then in MenuController::menuAction you call: $this-getHelper(ViewRenderer)-setNoRender(); $this-getResponse()-appendBody($view-render('foo/bar.phtml'), 'menu1'); The response is then not appended to the Main Content but to another named segment called 'menu1' in your layout.phtml you can then echo this named segment with: ?= $this-layout()-menu1; ? hope it helps. On Friday 08 August 2008 07:42:26 Greg Freeman wrote: What is the best way to create context dependent menu's etc in ZF? Does ZF have anything similar to slots or component slots such as those available in symfony? Thanks -- Benjamin Eberlei http://www.beberlei.de -- View this message in context: http://www.nabble.com/Context-Dependent-Menus-tp18885867p1706.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] zend registry problem
Dear All, i have a problem setting a value in Zend_Registry and retrieving it back in another page *here is the scenario, when a user log in i set his last login from the database in a variable :* Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row[user_last_login]); *and in the page he is redirected to i try to retrieve this variable like this :* Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); *the page return the following error :* The following error occurred: exception 'Zend_Exception' with message 'No entry is registered for key 'user_last_login'' in /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace: #0 /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46): Zend_Registry::get('user_last_login') #1 /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502): IndexController-indexAction() #2 /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action-dispatch('indexAction') #3 /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Library/WebServer/Documents/cha/admin/index.php(53): Zend_Controller_Front-dispatch() #5 {main} i dunno why it is not working while i can easily retrieve any variable i set in the registry in my bootstrap here is how i deal with the registry in my bootstrap $registery = Zend_Registry::getInstance(); Zend_Registry::set('connection', $config-database); Zend_Registry::set('pageLimit', $dataConfig-pages-limit); Zend_Registry::set('truepath', '/cha/application/admin/'); Zend_Registry::set('urlpath', 'http://localhost/cha/admin/'); can anyone give me a hand in this please ? thanks in advance. * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com* Acting by Reacting : By not printing this e-mail I help protect the environment.
Re: [fw-general] zend registry problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 can anyone give me a hand in this please ? You need to persist your Zend_Registry instance in a session, or use Zend_Session instead of Zend_Registry for storing the last login data. David. - -- David Goodwin Pale Purple Limited Office: 0845 0046746 Mobile: 07792380669 http://www.palepurple.co.ukCompany No: 5580814 'Business Web Application Development and Training in PHP' -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFInBXw/ISo3RF5V6YRAploAKCzRHvGMreFufmvwJquObSUDBu2LwCgy2Yk fgaMiQTmZqrewET7bz4ALPo= =FrRE -END PGP SIGNATURE-
[fw-general] Zend_Pdf and printing in general questions
Hi. I`m wondering if there is some kind of option to redirect output to the printer :) I`d like to create a functionality for preparing quite a lot of invoices and envelopes and after that print it automatically. At first, I thought about Zend_Pdf, although I don`t know how it will handle the creation of document with about 1200-1500 invoices and other with the same amount of pages for envelopes. It may take ages. Have someone used Zend_Pdf to create so many pages in file? Now I`m thinking about creating simple html pages for invoices and envelopes. Probably it shouldn`t be a problem to launch printing automatically after creation via JS. However, the problem which may occur here is the way it will print. Don`t know if there is option to mark where the end of invoice is and force to print another document on the new paper. I`d be very thankfull for any advices on this Regards, Mike -- View this message in context: http://www.nabble.com/Zend_Pdf-and-printing-in-general-questions-tp1957p1957.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] zend registry problem
On 8 Aug 2008, at 10:34, Ahmed Abdel-Aliem wrote: here is the scenario, when a user log in i set his last login from the database in a variable : Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row [user_last_login]); and in the page he is redirected to i try to retrieve this variable like this : Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); Hi, If you are using a **redirect** then you are starting a new request. You would need to store the last login data in a session (rather than the registry) in order to access it. Try: $session = new Zend_Session_Namespace('login'); $session-user_last_login = $user_row[user_last_login]; And $session = new Zend_Session_Namespace('login'); echo session-user_last_login; Regards, Carlton
Re: [fw-general] zend registry problem
Ahmed Abdel-Aliem schrieb: Dear All, i have a problem setting a value in Zend_Registry and retrieving it back in another page *here is the scenario, when a user log in i set his last login from the database in a variable :* Zend_Registry::getInstance(); Zend_Registry::set('user_last_login', $user_row[user_last_login]); *and in the page he is redirected to i try to retrieve this variable like this :* Zend_Registry::getInstance(); echo Zend_Registry::get('user_last_login'); *the page return the following error :* The following error occurred: exception 'Zend_Exception' with message 'No entry is registered for key 'user_last_login'' in /Library/WebServer/Documents/cha/library/Zend/Registry.php:145 Stack trace: #0 /Library/WebServer/Documents/cha/application/admin/controllers/IndexController.php(46): Zend_Registry::get('user_last_login') #1 /Library/WebServer/Documents/cha/library/Zend/Controller/Action.php(502): IndexController-indexAction() #2 /Library/WebServer/Documents/cha/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action-dispatch('indexAction') #3 /Library/WebServer/Documents/cha/library/Zend/Controller/Front.php(919): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /Library/WebServer/Documents/cha/admin/index.php(53): Zend_Controller_Front-dispatch() #5 {main} i dunno why it is not working while i can easily retrieve any variable i set in the registry in my bootstrap here is how i deal with the registry in my bootstrap $registery = Zend_Registry::getInstance(); Zend_Registry::set('connection', $config-database); Zend_Registry::set('pageLimit', $dataConfig-pages-limit); Zend_Registry::set('truepath', '/cha/application/admin/'); Zend_Registry::set('urlpath', 'http://localhost/cha/admin/'); can anyone give me a hand in this please ? thanks in advance. * Regards, Ahmed Abdel-Aliem Aroma Designs Solutions www.GraphicAroma.com www.AromaCreatives.com* Acting by Reacting : By not printing this e-mail I help protect the environment. Hi, i Use the Zend Registry with Zend_Registry::set( $strRegistryName, $objRegistryObject ); // use variables on the setRegistry Method anyware. and i get the Data with Zend_Registry::get( 'registry' ); Regards Carlos
Re: [fw-general] Zend_Pdf and printing in general questions
Hello Michal On Aug 8, 2008, at 11:49 AM, Michał Zieliński wrote: Hi. I`m wondering if there is some kind of option to redirect output to the printer :) http://www.kksou.com/php-gtk2/articles/interface-to-receipt-printer-in-a-point-of-sale-system.php have a look at this link, the author had a PHP-GTK program in mind but it will also work for printer connected to your server I`d like to create a functionality for preparing quite a lot of invoices and envelopes and after that print it automatically. At first, I thought about Zend_Pdf, although I don`t know how it will handle the creation of document with about 1200-1500 invoices and other with the same amount of pages for envelopes. It may take ages. Have someone used Zend_Pdf to create so many pages in file? I have done similar before using fpdf (the php4 predecessor of Zend_PDF) and that worked very well even for the numbers you are talking about. Although i would suggest making 3000 single page documents instead of 2 massive files. Because there is almost no hit in the creation of the files but all the processing time is spent in the layout preparation phase. In my application we prepare a pdf of the metrics in our LDAP workgroups (the users, their printer usage and pc's) which we sent to each workgroup administrator for financial review (they have to pay per unit of all 3 variables). The data retrieval, file creation of the 130 files and placing it in a email que takes under 1 sec. Now I`m thinking about creating simple html pages for invoices and envelopes. Probably it shouldn`t be a problem to launch printing automatically after creation via JS. However, the problem which may occur here is the way it will print. Don`t know if there is option to mark where the end of invoice is and force to print another document on the new paper. I think you are describing two problems here 1) You would like to know how to print files automatically from a webbrowser i think this an entirely different approach then automated printing because someone still needs be at the website end pressing the print button. Using the above approach you would be able to automate the process much further 2) you would like to know how to force a page end during the preparation and creation of the individual invoices/envelopes there are two way to do this. - You use the Zend_Pdf build in pages function, which takes care of this problem very easily. http://framework.zend.com/manual/en/zend.pdf.pages.html - You use the Zend_Pdf build in template load and overlay path http://framework.zend.com/manual/en/zend.pdf.create.html I`d be very thankfull for any advices on this Regards, Mike -- View this message in context: http://www.nabble.com/Zend_Pdf-and-printing-in-general-questions-tp1957p1957.html Sent from the Zend Framework mailing list archive at Nabble.com. also with regards Bram
[fw-general] Zend Form Grouping Elements
Hello, I have an element decorator for my elements and it is working corrent. It looks like this: public $elementDecorators = array( 'ViewHelper', 'MyErrors', array(array('data' = 'HtmlTag'), array('tag' = 'div', 'class' = 'element')), array('Label', array('class' = 'left')), array(array('row' = 'HtmlTag'), array('tag' = 'div', 'class' = 'row')), ); This renders code like this: div class=row label for=txtUserName class=required left optionalName/label div class=element input type=text name=txtUserName id=txtUserName value= size=30 maxlength=20 class=required / /div /div This is what I need :-) But now my problem. Sometime I want to have two or more elements in one row. Like perhaps zipcode and city. This should be rendered like this: div class=row label for=txtZipcode class=required left optionalZipcode/City/label div class=element input type=text name=txtZipcode id=txtZipcode value= size=10 maxlength=10 class=required / input type=text name=txtCity id=txtCity value= size=30 maxlength=20 class=required / /div /div I think, that I need to use DisplayGroups to achieve this. But I don't get it to work :-( I think this is a common problem. So hopefully some can give me a hint how my decorator needs to look like... Thanks for your Help, Stefan Sturm
Re: [fw-general] Zend_Form select element validation error, after changes in revision 10523.
Matthew, The array layout of my $languages var is: Array ( [en] = Engels [nl] = Nederlands ) However! I'm using a custom formLanguageSelect view helper (extends Zend_View_Helper_FormSelect) to create the select options and elements. Zend_View_Helper_FormSelect hasn't changed lately, so I would expect my custom view helper to work properly. Unless you forsee some intertwined connection between the helper, element and validator??? Regards, TJ. On Thu, Aug 7, 2008 at 10:12 PM, Matthew Weier O'Phinney [EMAIL PROTECTED]wrote: -- Taco Jung [EMAIL PROTECTED] wrote (on Thursday, 07 August 2008, 09:42 PM +0200): You're right, __addition__. I had my compare views mixed up in Eclipse. This behavior was added by default as it was an oft-requested feature with many votes. That would be because you can check if the value passed by the user, is actually a value allowed (registered in the stack)? Yes. It takes the array_keys from the multi options, and passes them to an InArray validator. If so, why do I get the validation error message? My values of en/nl are added through $form-getElement('language')-setMultiOptions($languages), where $languages is an array. Where does the stack get created? Is the array multi-dimensional? If so, it won't work. Otherwise, it should; if it isn't could you pass me the $languages array so I can take a look? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] Zend Form Grouping Elements
-- Stefan Sturm [EMAIL PROTECTED] wrote (on Friday, 08 August 2008, 02:12 PM +0200): I have an element decorator for my elements and it is working corrent. It looks like this: public $elementDecorators = array( 'ViewHelper', 'MyErrors', array(array('data' = 'HtmlTag'), array('tag' = 'div', 'class' = 'element')), array('Label', array('class' = 'left')), array(array('row' = 'HtmlTag'), array('tag' = 'div', 'class' = 'row')), ); This renders code like this: div class=row label for=txtUserName class=required left optionalName/label div class=element input type=text name=txtUserName id=txtUserName value= size=30 maxlength=20 class=required / /div /div This is what I need :-) But now my problem. Sometime I want to have two or more elements in one row. Like perhaps zipcode and city. This should be rendered like this: div class=row label for=txtZipcode class=required left optionalZipcode/City/label div class=element input type=text name=txtZipcode id=txtZipcode value= size=10 maxlength=10 class=required / input type=text name=txtCity id=txtCity value= size=30 maxlength=20 class=required / /div /div I think, that I need to use DisplayGroups to achieve this. But I don't get it to work :-( What did you try? :) Here's what I'd try: you'll need to create a custom decorator for the display group, which I'll detail below, and then the following element/group definitions. $form-addDisplayGroupPrefixPath('My_Form_Decorator', 'My/Form/Decorator'); $form-addElement('text', 'txtZipcode', array( 'size' = 10, 'maxlength' = 10, 'class' = 'true', 'required' = 'true', 'decorators' = array('ViewHelper'), )); $form-addElement('text', 'txtCity', array( 'size' = 30, 'maxlength' = 20, 'class' = 'true', 'required' = 'true', 'decorators' = array('ViewHelper'), )); $form-addDisplayGroup(array('txtZipcode', 'txtCity'), 'zipCity', array( 'legend' = 'Zipcode/City', 'decorators' = array( 'FormElements', array('DivWrapper', array( 'labelFor' = 'txtZipcode', 'labelClass' = 'required left optional', )) ), )); The DivWrapper decorator would look like this: My_Form_Decorator_DivWrapper extends Zend_Form_Decorator_Abstract() { public function render($content) { $group = $this-getElement(); if (null === $group) { return $content; } $labelFor = $this-getOption('labelFor'); $labelClass = $this-getOption('labelClass'); $label = $group-getLegend(); $html =EOH div class=row label for=$labelFor class=$labelClass$label/label div class=element $content /div /div EOH; return $html; } } Put the above in My/Form/Decorator/DivWrapper.php on your include path, and you should be set. I think this is a common problem. So hopefully some can give me a hint how my decorator needs to look like... -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
RE: [fw-general] Multiple Controller Directories
thank you for yoru reply. going through this, it seems as though it will be only using one dir/app rather than checking both. I want all requests to go through /applicaion/commonground and if the controller is not found there, to check in the /application/xxx depending on the subdomain. so when I go to: sub1.domain.com/sayhi it will first look in /application/commonground/controllers for tha controller, but since it doesnt exist in there, it will also then check in the /application/sub1/controllers dir for SayhiController.php I am trying to set this up per the documentation, but it doesnt seem to be working. Keith Pope-3 wrote: Sorry I didnt read your email fully, its early :) You could try using the router to eliminate the modules problem you have, checkout the docs http://framework.zend.com/manual/en/zend.controller.router.html section 7.5.6.1.3. Hostname routing Keith Pope Web Developer -- View this message in context: http://www.nabble.com/Multiple-Controller-Directories-tp18879750p18892836.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Subdomains and Zend Framework
I am trying to do something similar and any advice would be great. I have the following structure /application --/commonground /bootstrap.php /controllers --/AclController.php --/sub1 /controllers --/HelloController.php --/sub2 /controllers --/SecretController.php I have sub1.domain.com and sub2.domain.com Controllers in the /commonground module, should be accessible for all requests (ACL and Custom functions are here as well as shared code between sub1 and sub2) I want to be able to call: sub1.domain.com/hello and have the HelloController properly process as well as any in the /commonground if needed (such as ACL) Is this possible? Thank you. Jerry McG wrote: Hi All, I have a file system layout similar to the recommendation at http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go.directory I would like to work with subdomains such as http://chicago.example.com and http://newyork.example.com. I have added these subdomains in my Apache virtual hosts file as well as in the Windows hosts file. Now, how can I make subdomains work in Zend Framework. Should I create folders called Chicago and Newyork and repeat the recommended layout within these folders? Please guide me. Thanks! Jerry. -- View this message in context: http://www.nabble.com/Subdomains-and-Zend-Framework-tp17125088p18893921.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Multiple Controller Directories
maxarbos schrieb: thank you for yoru reply. going through this, it seems as though it will be only using one dir/app rather than checking both. I want all requests to go through /applicaion/commonground and if the controller is not found there, to check in the /application/xxx depending on the subdomain. so when I go to: sub1.domain.com/sayhi it will first look in /application/commonground/controllers for tha controller, but since it doesnt exist in there, it will also then check in the /application/sub1/controllers dir for SayhiController.php I am trying to set this up per the documentation, but it doesnt seem to be working. Keith Pope-3 wrote: Sorry I didnt read your email fully, its early :) You could try using the router to eliminate the modules problem you have, checkout the docs http://framework.zend.com/manual/en/zend.controller.router.html section 7.5.6.1.3. Hostname routing Keith Pope Web Developer Hi, I use more than one Directory Controller: I set the Name of Controller and Directory on the Controller instance. Like this: $frontController = Zend_Controller_Front::getInstance(); $frontController-setControllerDirectory(array('default' =BASEPATH.'/controllers')); $frontController-run('controllers'); You must to use the same structure Regards Carlos
[fw-general] ZF 1.6.0 RC2 sanity check packages.
Hi all! The sanity check release for Zf 1.6.0RC2 is now available here: http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-apidoc .tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-apidoc .zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -de.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -de.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -en.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -en.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -fr.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -fr.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -ja.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -ja.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -ru.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -ru.zip http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -zh.tar.gz http://framework.zend.com/releases/preview/ZendFramework-1.6.0RC2-manual -zh.zip Note that this is *NOT* the official release of 1.6.0RC2. If we find no major issues with these builds, we will issue official 1.6.0RC2 release from this tag soon. Please do *NOT* log any issues found in these archives in the issue tracker; instead post any major functional or packaging issues to this list or mail them to me directly ([EMAIL PROTECTED]). With best regards, Alexander Veremyev.
[fw-general] Multi Checkbox options escaping
Hi, Is there any way to disable escaping for multicheckbox options ? I'm creating a multi checkbox element with linked options like this: $element = new Zend_Form_Element_MultiCheckbox('foo', array( 'multiOptions' = array( 'foo' = 'lt;a href=#gt;Foo Optionlt;/agt;', 'bar' = 'lt;a href=#gt;Bar Optionlt;/agt;', 'baz' = 'lt;a href=#gt;Baz Optionlt;/agt;', 'bat' = 'lt;a href=#gt;Bat Optionlt;/agt;', ); )); When the multi checkbox is displayed links are escaped. I tried to remove escaping for multi checkbox like this: $label = $element-getDecorator('label'); $label-setOption('escape', false); but this applies only to multi checkbox's label but not to it's options. Thank you. -- View this message in context: http://www.nabble.com/Multi-Checkbox-options-escaping-tp18874104p18874104.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Subdomains and Zend Framework
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yes, this is exacly what you want. But if you want module routes (the default routes with the Zend_Controller_Router_Route_Module), the hostname route does not help you. It only works with predefined routes. IMHO, they are better anyway, because the URLs are more SEO friendly. In general, I would suggest you to put the common modules on another subdomain, as else you would get duplicate content in google, so a bad rating. Bill P. schrieb: Hi Ben, Thanks for the reply. I am not sure if this is going to be what I am looking for. What I am trying to achieve is to have one place that common scripts such as the aclcontroller, customstuffcontroller, errorcontroller, indexcontroller, personalaccountcontroller, etc... these would be in the /app/commomground dir. When some goes to sub1.domain.com/ or sub2.domain.com/ the indexcontroller would be called from the /commonground dir... because there isnt an indexcontroller in the /application/sub1 or /application/sub2 dir. then when someone goes to sub1.domain.com/hello, the hellocontroller would be called but the application would also have access to find the aclcontroller and run that for the acl control on the site. What you sent me, may do what I need, but not sure if i understand it right. We are splitting this because there will be shared controllers between the two modules such as personalaccount. Instead of having to write two idenitcal controllers, we are just using them there. Also, doing it without the module name in the url such as: domain.com/sub1 or domain.com/sub2, it eliminates the need to write two rules for the access control to the same info such as domain.com/sub1/personalaccount and domain.com/sub2/personalaccount. Does that all make sense? Thanks. Bill --- On *Fri, 8/8/08, Ben Scholzen 'DASPRiD' /[EMAIL PROTECTED]/* wrote: From: Ben Scholzen 'DASPRiD' [EMAIL PROTECTED] Subject: Re: [fw-general] Subdomains and Zend Framework To: maxarbos [EMAIL PROTECTED] Date: Friday, August 8, 2008, 12:10 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi maxarbos, What you are looking for is the new hostname route, which will be shipped with ZF 1.6 RC 2. Basically yo do the following: - a) Create your base routes: $aclRoute= new Zend_Controller_Router_Route_Static('acl'); $helloRoute = new Zend_Controller_Router_Route_Static('hello'); $secretRoute = new Zend_Controller_Router_Route_Static('secret'); b) Create the hostname routes: $sub1Route = new Zend_Controller_Router_Route_Hostname('sub1.d.com'); $sub2Route = new Zend_Controller_Router_Route_Hostname('sub2.d.com'); c) Chain your base routes to the hostname routes $sub1Route-chain($aclRoute) -chain($helloRoute); $sub2Route-chain($aclRoute) -chain($secretRoute); - With this setup, you can access the following URLs: http://sub1.d.com/acl http://sub1.d.com/hello http://sub2.d.com/acl http://sub2.d.com/secret This is the complete programatical way. I hadn't time to implement config-support for the chaining yet, but I will try to get it into 1.6 final (at least in trunk it will be in a the near future). Regards, Ben maxarbos schrieb: I am trying to do something similar and any advice would be great. I have the following structure /application --/commonground /bootstrap.php /controllers --/AclController.php --/sub1 /controllers --/HelloController.php --/sub2 /controllers --/SecretController.php I have sub1.domain.com and sub2.domain.com Controllers in the /commonground module, should be accessible for all requests (ACL and Custom functions are here as well as shared code between sub1 and sub2) I want to be able to call: sub1.domain.com/hello and have the HelloController properly process as well as any in the /commonground if needed (such as ACL) Is this possible? Thank you. Jerry McG wrote: Hi All, I have a file system layout similar to the recommendation at http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go.directory I would like to work with subdomains such as http://chicago.example.com and http://newyork.example.com. I have added these subdomains in my Apache virtual hosts file as well as in the Windows hosts file. Now, how can I make subdomains work in Zend Framework. Should I create
[fw-general] How to access current url in custom view helper?
Hello, I am trying to construct an HTML anchor link in my custom view helper. How can I know the current URL in the view helper? I tried to create a frontController instance and access the getBaseUrl method. I did not return anything. -- With warm regards, Sudheer. S http://binaryvibes.co.in
[fw-general] Duplicate emails. . .
Hi all, it's my favorite time of the week- time to go through the spam filter! The duplicate messages you're seeing right now are people trying to mail the list multiple times but getting caught in the filter. Please ignore (all but one, which you should respond to if you can). ;) ,Wil
[fw-general] Zend_Service_Delicous partially broken: delicous silently changed their feed urls ...
Hi, delicous did not only get their v2 online but also broke the old json feed url. I did not find any blog / news about this and don't know since when it has been switched... It's now http://feeds.delicious.com/v1/json/[user] Old one was: http://del.icio.us/v1/json/[user] This has to be fixed in ZF, too, because currently at least the JSON urls are broken. Changing JSON_URI did the trick here. Anyone? :) Thanks! -soenke signature.asc Description: OpenPGP digital signature
[fw-general] [Zend_View] and global view vars best practice?
Hi every body, I’m bringing back a subject about global view variables which have already been discussed here http://www.nabble.com/Why-Zend_View_Helper_Partial-clears-all-assigned-variables-in-cloned-views--td15701331.html With global view variables I mean view variable setup in the bootstrap and shared across views and partials. I mostly use them to store the url of the application assets (css, images, javascript, swf, ...). I find this method more elegant than using globals or constants. I did this before partials and placeholder exits. But now all the view variables are clear in the partials helpers so I need to overload the partials cloneView() method and with the help of the Zend_Registry I declare which vars are globals so they are not cleared. Not very elegant though… In the above thread Matthew recommend to use the placeholders helper to be able to use view variables with global space. But I’m to sure on how to properly use it : Right now I’m doing something like this in my bootstrap: $view-urlRoot = 'http://'.$_SERVER['HTTP_HOST'].$appConfig-url-base; $view-urlAssets = 'http://'.$appConfig-url-assets; $view-urlImages = $view-urlTheme.'/images'; $view-urlSwf = $view-urlTheme.'/swf'; $view-urlMedias = $view-urlAssets.'/medias'; $view-urlCss = $view-urlTheme.'/css'; $view-urlJs = $view-urlTheme.'/javascript'; So should I do: 1) One placeholder + key $this-placeholder('Mmx_View_Globals')-urlRoot $this-placeholder('Mmx_View_Globals')-urlAssets $this-placeholder('Mmx_View_Globals')-urlTheme $this-placeholder('Mmx_View_Globals')-urlImages 2) A placeholder for each var $this-placeholder('urlRoot') $this-placeholder('urlAssets') $this-placeholder('urlTheme') $this-placeholder('urlImages') 3) A special helper which extends Zend_View_Helper_Placeholder_Container_Standalone $view-globals()-urlRoot $view-globals()-urlAssets $view-globals()-urlTheme; $view-globals()-urlImages 4) Keep using my current setup 5) Other suggestions? What are your recommendations ? I'm curious to know how others tackled this problem too. Thanks for ridding this topics, Regards, -- Laurent Melmoux Conseil et Solutions Web | [EMAIL PROTECTED] 2mx - Annecy, France | http://www.2mx.fr/
[fw-general] Zend_Form Array notation
Hello, I have come across a situation where I have to create form elements based on information stored in the database. For each value I want to create a checkbox form field element. Without Zend_Form I would do something like this: [snip] form name=edituser action=/user/edit method=post / Email: input type=text name=username value=?php echo $email; ? / br / Roles: br / ?php $sql = SELECT name FROM role; $result = $db-fetchAll($sql); foreach ($result as $row) { $role = $row['name']; echo $role; echo input type=\checkbox\ name=\row[$role]\ value=\set\ / br /; } ? input type=submit name=submit value=submit / /form [/snip] How can I achieve the objective using Zend_Form? Specifically, I would like to know how to build form elements whose names are represented by arrays. I have read the subform section of the manual. But I'm unable to understand how to implement it in this situation. I would greatly appreciate if somebody can show an example. -- With warm regards, Sudheer. S http://binaryvibes.co.in
[fw-general] Zend_Form retain select value=0 on invalid submission
I have a form that has a select field with two values: 1 and 0. select name=testfield option value=1Yes/option option value=0No/option /select When I submit the form and it is invalid, this select box does not remember the value of this field. It always defaults to '1'. There is no default value listed in the form builder file. All other fields of the form, including the other select fields retain their values when there is no '0' value choosen. Any advice would be great. Thanks. -- View this message in context: http://www.nabble.com/Zend_Form-retain-select-value%3D%220%22-on-invalid-submission-tp18712028p18712028.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] [Zend_View] and global view vars best practice?
-- Laurent Melmoux [EMAIL PROTECTED] wrote (on Friday, 01 August 2008, 06:54 PM +0200): snip -- narrative on problems of global view variables now that partials exist So should I do: 1) One placeholder + key $this-placeholder('Mmx_View_Globals')-urlRoot $this-placeholder('Mmx_View_Globals')-urlAssets $this-placeholder('Mmx_View_Globals')-urlTheme $this-placeholder('Mmx_View_Globals')-urlImages 2) A placeholder for each var $this-placeholder('urlRoot') $this-placeholder('urlAssets') $this-placeholder('urlTheme') $this-placeholder('urlImages') 3) A special helper which extends Zend_View_Helper_Placeholder_Container_Standalone $view-globals()-urlRoot $view-globals()-urlAssets $view-globals()-urlTheme; $view-globals()-urlImages I personally think this option (3) makes the most sense, although I wouldn't call it 'globals' -- namespace it with something a little more meaningful or specific to your project. But it makes the implementation very clean and relatively simple to implement. 4) Keep using my current setup 5) Other suggestions? What are your recommendations ? I'm curious to know how others tackled this problem too. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/