[fw-general] Zend _Acl Adding resource question
Good Day, I have implemented a modular directory structure. modules/ admin/ controllers/ IndexController.php default/ controllers/ IndexController.php How do I add them as a resource to Zend_Acl? Cheers, Garri
Re: [fw-general] Zend _Acl Adding resource question
Try reading this links: http://www.nabble.com/Re:-Extend-acl-to-include-modules-p10810058s16154.html http://www.nabble.com/Re:-Extend-acl-to-include-modules-p10810222s16154.html Hope it helps. Best regards, artiskool P.S. Kababayan tayo if I'm not mistaken. On Feb 12, 2008 4:25 PM, Garri Santos [EMAIL PROTECTED] wrote: On Tue, Feb 12, 2008 at 4:17 PM, Jason Qi [EMAIL PROTECTED] wrote: go here http://www.zend.com/en/resources/webinars/framework to see Darby's Webinar Hope this helps Jason. Garri Santos [EMAIL PROTECTED] wrote: Good Day, I have implemented a modular directory structure. modules/ admin/ controllers/ IndexController.php default/ controllers/ IndexController.php How do I add them as a resource to Zend_Acl? Cheers, Garri Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. I have already watched it. It is the basis of the application im making in ZF but in his example is not set to using modules. In my example above they are both IndexController though one is Admin_Index. I thought adding Admin_Index to the resource since that is the objects name but it can't find it as a resource in Zend_Acl. Cheers, Garri -- Arthur N. Layese, Software Engineer InfoWeapons Corporation Unit 702, 7/F Skyrise Bldg., Asiatown I.T. Park, Apas Cebu City, Philippines 6000 Phones: +63.32.238.0088 , +63.32.415.8442 Fax: +63.32.238.0077 Mobile: +63.917.810.2982 Emails: [EMAIL PROTECTED] , [EMAIL PROTECTED] Websites: http://arthur.layese.com , http://www.infoweapons.com , http://artiskool.blogspot.com Favorite Quotes: For I know the plans I have for you, declares the LORD, plans to prosper you and not to harm you, plans to give you hope and a future. -- Jeremiah 29:11 - New International Version (NIV) This email and/or attachments are confidential and may also be legally privileged. If you are not the intended recipient, you are hereby notified, that any review, dissemination, distribution or copying of this email and/or attachments is strictly prohibited. Please notify [EMAIL PROTECTED] immediately by email and delete this message and all its attachments. Thank you.
Re: [fw-general] Zend _Acl Adding resource question
You can also get the basic usage here http://jeremyknope.com/articles/2007/06/18/experience-with-zend_acl-and-usage-example Best regards, artiskool On Feb 12, 2008 4:25 PM, Garri Santos [EMAIL PROTECTED] wrote: On Tue, Feb 12, 2008 at 4:17 PM, Jason Qi [EMAIL PROTECTED] wrote: go here http://www.zend.com/en/resources/webinars/framework to see Darby's Webinar Hope this helps Jason. Garri Santos [EMAIL PROTECTED] wrote: Good Day, I have implemented a modular directory structure. modules/ admin/ controllers/ IndexController.php default/ controllers/ IndexController.php How do I add them as a resource to Zend_Acl? Cheers, Garri Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. I have already watched it. It is the basis of the application im making in ZF but in his example is not set to using modules. In my example above they are both IndexController though one is Admin_Index. I thought adding Admin_Index to the resource since that is the objects name but it can't find it as a resource in Zend_Acl. Cheers, Garri
Re: [fw-general] Zend _Acl Adding resource question
On Tue, Feb 12, 2008 at 4:17 PM, Jason Qi [EMAIL PROTECTED] wrote: go here http://www.zend.com/en/resources/webinars/framework to see Darby's Webinar Hope this helps Jason. Garri Santos [EMAIL PROTECTED] wrote: Good Day, I have implemented a modular directory structure. modules/ admin/ controllers/ IndexController.php default/ controllers/ IndexController.php How do I add them as a resource to Zend_Acl? Cheers, Garri Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. I have already watched it. It is the basis of the application im making in ZF but in his example is not set to using modules. In my example above they are both IndexController though one is Admin_Index. I thought adding Admin_Index to the resource since that is the objects name but it can't find it as a resource in Zend_Acl. Cheers, Garri
Re: [fw-general] Zend _Acl Adding resource question
go here http://www.zend.com/en/resources/webinars/framework to see Darby's Webinar Hope this helps Jason. Garri Santos [EMAIL PROTECTED] wrote: Good Day, I have implemented a modular directory structure. modules/ admin/ controllers/ IndexController.php default/ controllers/ IndexController.php How do I add them as a resource to Zend_Acl? Cheers, Garri - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: [fw-general] Zend_Form and validation language
Matthew Weier O'Phinney-3 wrote: Can you clarify exactly what's happening? Are placeholders such as %value% not getting substitutions, or are you expecting the substitution to be translated? For example, I'm using Zend_Translate to translate Zend_Validate_StringLength error messages in french : $translate = new Zend_Translate('array', array( Zend_Validate_StringLength::TOO_SHORT = '%value%' doit avoir au minimum %min% caractère(s), Zend_Validate_StringLength::TOO_LONG= '%value%' doit avoir au maximum %max% caractère(s) )); $form = new Zend_Form(); $form-setTranslator($translate); ... $name = new Zend_Form_Element_Text('name'); $name-addValidator(new Zend_Validate_StringLength(4, 10)); With 'abc' as value of $name, the displayed message will be (without translator) : 'abc' is less than 4 characters long. With my translator, il will be : '%value%' doit avoir au minimum %min% caractère(s), without variable substitution. -- View this message in context: http://www.nabble.com/Zend_Form-and-validation-language-tp15248574s16154p15439264.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re[fw-general] gistry values disappear
-- NShewmaker [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 01:10 PM -0800): I initialize my Registry in my bootstrap with a few values. My index/index action then tries to add some data, with set(). If I immediately output the registry, I can see the new addition. However, it does not persist to other actions in the index (or any other) controller. Must all set()s be done in the bootstrap? Must I use Zend_Session, instead? Based on what you're describing, it sounds like you're expecting Zend_Registry to persist data *between* requests. However, it doesn't. If you want to persist data between requests, use Zend_Session. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend_Form multipage examples?
-- Justin Hendrickson [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 01:56 PM -0600): I'm trying to put together a simple Zend_Form setup for a multipaged form, but the documentation on implementing the multipage part is a bit sparse. I'm aware of that; I haven't had a chance to work up more advanced use cases and examples for this bit of functionality yet. A note or two below: Once the form object is setup with the subforms, what's the right way to render and validate the subforms and process the results? This is what I have right now: ?php require_once 'ApplicationController.php'; require_once 'Zend/Form.php'; class IndexController extends ApplicationController { public function siteInformationAction() { $subform = $this-_getForm()-getSubForm('site_information'); if ($this-getRequest()-isPost() $subform-isValid($this- getRequest()-getPost())) { return $this-getHelper('redirector')-gotoRoute( You'll probably want to store the data from validating the subform in your session so you can retrieve it later; otherwise, your data will be lost. There's a variety of ways to do that -- using $_SESSION directly, or using Zend_Session -- so I won't go into details. array( 'action' = 'personalInformation' ) ); } $this-view-form = $subform; $this-render('form'); } public function personalInformationAction() { $subform = $this-_getForm()-getSubForm('personal_information'); if ($this-getRequest()-isPost() $subform-isValid($this- getRequest()-getPost())) { var_dump($this-_getForm()-getValues()); exit; } $this-view-form = $subform; $this-render('form'); } private function _getForm() { return new Zend_Form(array( 'method' = 'POST', 'subforms' = array( 'site_information' = new Zend_Form(array( 'elements' = array( 'username' = array( 'text', array( 'label' = 'Username', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'password' = array( 'password', array( 'label' = 'Password', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'submit_site_information' = array( 'submit', array( 'value' = 'Next Page' ) ) ) )), 'personal_information' = new Zend_Form(array( 'elements' = array( 'name' = array( 'text', array( 'label' = 'Name', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'street' = array( 'text', array( 'label' = 'Street', ) ), 'city' = array( 'text', array( 'label' = 'City' ) ), 'state' = array( 'text', array( 'label' = 'State' ) ), 'zip' = array( 'text', array( 'label' = 'Zip' ) ), 'submit_personal_information' = array( 'submit', array( 'value' = 'Submit' ) ) ) )) ) )); } } Unfortunately, I'm
Re: [fw-general] Zend_Form multipage examples?
Hi Justin On top of what you have here for persisting data from form submission, the helper proposal allows you to specify the order in which forms are processed. So you can prevent someone from jumping straight to the 'personal' action if the 'siteinformation' form has not yet been validated. That, and it also interacts with the redirector to allow you to specify a destination action using the key names of form submit elements (_next, _back, _submit, etc..) if you're operating a 'wizard'- style or even tabbed-style interface. Cheers You'll probably want to store the data from validating the subform in your session so you can retrieve it later; otherwise, your data will be lost. There's a variety of ways to do that -- using $_SESSION directly, or using Zend_Session -- so I won't go into details. I just found the persistData(), thought it doesn't appear to be used anywhere. I did some more hacking and added Zend_Session_Namespace into the mix. I'll check out the Helper proposal to see if I'm missing anything. In case anyone wanted to see my current, semi-working example, here ya go: ?php require_once 'ApplicationController.php'; require_once 'Zend/Form.php'; require_once 'Zend/Session/Namespace.php'; class IndexController extends ApplicationController { public function siteInformationAction() { $subform = $this-_getForm()-getSubForm('site_information'); if ($this-getRequest()-isPost() $subform-isValid($this- getRequest()-getPost())) { $subform-persistData(); return $this-getHelper('redirector')-gotoRoute( array( 'action' = 'personalInformation' ) ); } $this-view-form = $subform; $this-render('form'); } public function personalInformationAction() { $subform = $this-_getForm()- getSubForm('personal_information'); if ($this-getRequest()-isPost() $subform-isValid($this- getRequest()-getPost())) { $subform-persistData(); $this-_getForm()-process(); exit; } $this-view-form = $subform; $this-render('form'); } private function _getForm() { return new Site_Form_Create(); } } class Site_Form_Create extends Zend_Form { public function __construct() { parent::__construct(array( 'method' = 'POST', 'subforms' = array( 'site_information' = new Site_Form_Create_SiteInformation(), 'personal_information' = new Site_Form_Create_PersonalInformation() ) )); } public function process() { foreach ($this-getSubForms() as $subform) { var_dump($subform-getValues()); } } } class Site_Form_Create_SiteInformation extends Zend_Form { public function __construct() { parent::__construct(array( 'elements' = array( 'username' = array( 'text', array( 'label' = 'Username', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'password' = array( 'password', array( 'label' = 'Password', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'submit_site_information' = array( 'submit', array( 'value' = 'Next Page' ) ) ) )); foreach ($this-_getSession() as $key = $value) { $this-getElement($key)-setValue($value); } } public function persistData() { $session = $this-_getSession(); foreach ($this-getValues() as $key = $value) { $session-$key = $value; } } private function _getSession() { return new Zend_Session_Namespace('Site_Form_Create_SiteInformation'); } } class Site_Form_Create_PersonalInformation extends Zend_Form { public function __construct() { parent::__construct(array( 'elements' = array( 'name' = array( 'text', array( 'label' = 'Name', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'street' = array( 'text', array( 'label' = 'Street', )
Re: [fw-general] Zend_Form multipage examples?
Or you can use Jurrien's proposal code as a starting point :) See http://framework.zend.com/wiki/pages/viewpage.action?pageId=42130 You'll probably want to store the data from validating the subform in your session so you can retrieve it later; otherwise, your data will be lost. There's a variety of ways to do that -- using $_SESSION directly, or using Zend_Session -- so I won't go into details. -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
Re: [fw-general] Zend_Form and validation language
-- ALkyD [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 10:18 AM -0800): Matthew Weier O'Phinney-3 wrote: Can you clarify exactly what's happening? Are placeholders such as %value% not getting substitutions, or are you expecting the substitution to be translated? For example, I'm using Zend_Translate to translate Zend_Validate_StringLength error messages in french : $translate = new Zend_Translate('array', array( Zend_Validate_StringLength::TOO_SHORT = '%value%' doit avoir au minimum %min% caractère(s), Zend_Validate_StringLength::TOO_LONG= '%value%' doit avoir au maximum %max% caractère(s) )); $form = new Zend_Form(); $form-setTranslator($translate); ... $name = new Zend_Form_Element_Text('name'); $name-addValidator(new Zend_Validate_StringLength(4, 10)); With 'abc' as value of $name, the displayed message will be (without translator) : 'abc' is less than 4 characters long. With my translator, il will be : '%value%' doit avoir au minimum %min% caractère(s), without variable substitution. I committed changes earlier today in response to another issue report on the fw-mvc list that should correct this. Please pull from current svn and test, please. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Re[fw-general] gistry values disappear
I initialize my Registry in my bootstrap with a few values. My index/index action then tries to add some data, with set(). If I immediately output the registry, I can see the new addition. However, it does not persist to other actions in the index (or any other) controller. Must all set()s be done in the bootstrap? Must I use Zend_Session, instead? -- View this message in context: http://www.nabble.com/Registry-values-disappear-tp15443175s16154p15443175.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend_Form multipage examples?
I'm trying to put together a simple Zend_Form setup for a multipaged form, but the documentation on implementing the multipage part is a bit sparse. Once the form object is setup with the subforms, what's the right way to render and validate the subforms and process the results? This is what I have right now: ?php require_once 'ApplicationController.php'; require_once 'Zend/Form.php'; class IndexController extends ApplicationController { public function siteInformationAction() { $subform = $this-_getForm()-getSubForm('site_information'); if ($this-getRequest()-isPost() $subform-isValid($this-getRequest()-getPost())) { return $this-getHelper('redirector')-gotoRoute( array( 'action' = 'personalInformation' ) ); } $this-view-form = $subform; $this-render('form'); } public function personalInformationAction() { $subform = $this-_getForm()-getSubForm('personal_information'); if ($this-getRequest()-isPost() $subform-isValid($this-getRequest()-getPost())) { var_dump($this-_getForm()-getValues()); exit; } $this-view-form = $subform; $this-render('form'); } private function _getForm() { return new Zend_Form(array( 'method' = 'POST', 'subforms' = array( 'site_information' = new Zend_Form(array( 'elements' = array( 'username' = array( 'text', array( 'label' = 'Username', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'password' = array( 'password', array( 'label' = 'Password', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'submit_site_information' = array( 'submit', array( 'value' = 'Next Page' ) ) ) )), 'personal_information' = new Zend_Form(array( 'elements' = array( 'name' = array( 'text', array( 'label' = 'Name', 'required' = true, 'validators' = array( 'NotEmpty' ) ) ), 'street' = array( 'text', array( 'label' = 'Street', ) ), 'city' = array( 'text', array( 'label' = 'City' ) ), 'state' = array( 'text', array( 'label' = 'State' ) ), 'zip' = array( 'text', array( 'label' = 'Zip' ) ), 'submit_personal_information' = array( 'submit', array( 'value' = 'Submit' ) ) ) )) ) )); } } Unfortunately, I'm obviously missing something because var_dump($this-_getForm()-getValues()); is giving me array() . Is my approach completely off? Also, how do you go about preventing someone from manually going to the personalInformationAction()?
Re: [fw-general] Zend_Form multipage examples?
-- Justin Hendrickson [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 04:09 PM -0600): You'll probably want to store the data from validating the subform in your session so you can retrieve it later; otherwise, your data will be lost. There's a variety of ways to do that -- using $_SESSION directly, or using Zend_Session -- so I won't go into details. I just found the persistData(), thought it doesn't appear to be used anywhere. It's actually not even implemented. :-) (note to self: either remove, or raise a warning in that method...) -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Preferred method of returning changes to form element after ajax call
Hi, with Zend_Form on the horizont I was wondering if there is a preferred method of returning changes to a form element on a webpage after an ajax call. For example when I select a certain checkbox and push a button on a form, an ajax call is made that should return an updated select element and disable another button. Would I then build a Zend_Form_Element_Select and Element_Button in the controller, render them, put the output in an array, return the rendered elements to my javascript and replace the old elements? Or can I serialize a Zend_Form_Element to JSON and use its public properties after eval()ing it to an object in my javascript? But AFAIK all the data in form elements is returned via methods, so this is not of much use on the client. Another thought: Always transmitting complete form elements in an ajax return might not be very efficient if only one property of an element is changed by an action (for example disabled)... Right now I am using something selfmade (without Zend Form), but on the way to 1.5 I'd appreciate your thoughts on this. Thanks and best regards, Georg
Re: [fw-general] Zend_Form and validation language
Hello, Is there a way to translate variables like %value%, %min%, %max%, etc. in the Zend_Translate object ? When I build my personalized messages, the variables aren't parsed when I put the Zend_Translate object into Zend_Form instance with setTranslator()... -- View this message in context: http://www.nabble.com/Zend_Form-and-validation-language-tp15248574s16154p15433970.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Form and validation language
-- ALkyD [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 06:13 AM -0800): Is there a way to translate variables like %value%, %min%, %max%, etc. in the Zend_Translate object ? When I build my personalized messages, the variables aren't parsed when I put the Zend_Translate object into Zend_Form instance with setTranslator()... Can you clarify exactly what's happening? Are placeholders such as %value% not getting substitutions, or are you expecting the substitution to be translated? If the former -- the '%value%' type placeholders are not being substituted with the appropriate values, this is likely an issue of where you're getting ZF from. The 1.5.0PR release did not have these changes, and there have been some reports that the nightly snapshots have not either. Try grabbing directly from SVN and see if your results are any better. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] ZF and SEO issues
Hi, Some of my content can have more than one Url, e.g. : * http://www.example.com/read_inbox/mail/15 * http://www.example.com/read-inbox/mail/15 * http://www.example.com/readInbox/mail/15 * etc. This is wrong regarding SEO. You will probably reply me that I should just use one type of url in my application, but what if someone links a different url to my site ? Also maybe someone that doesn't want your site to get well ranked can use this trick. This article also explains this problem: http://www.mindloop.be/nieuws/nieuwe-ontwikkelingen/seo-warning--zend-framework-and-duplicate-content Thank you for any reply -- View this message in context: http://www.nabble.com/ZF-and-SEO-issues-tp15434531s16154p15434531.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] ZF and SEO issues
(Sorry debussy007 for sending this to you personally) On 12/02/2008, Vincent [EMAIL PROTECTED] wrote: On 12/02/2008, debussy007 [EMAIL PROTECTED] wrote: Hi, Some of my content can have more than one Url, e.g. : * http://www.example.com/read_inbox/mail/15 * http://www.example.com/read-inbox/mail/15 * http://www.example.com/readInbox/mail/15 * etc. This is wrong regarding SEO. You will probably reply me that I should just use one type of url in my application, but what if someone links a different url to my site ? Also maybe someone that doesn't want your site to get well ranked can use this trick. This article also explains this problem: http://www.mindloop.be/nieuws/nieuwe-ontwikkelingen/seo-warning--zend-framework-and-duplicate-content Thank you for any reply It is highly unlikely that a visitor would go switching around those URLs by himself (probably doesn't even know it's possible). If a competitor wants to like to such URLs to harm you he'll probably only help you because he adds another link back to your site. Best, -- Vincent -- Vincent