Re: [fw-general] Route Rewrite Problem
Hi I never mentioned the default values in my rules... and it works fine for me... May be its different in different versions But i am not sure.. Regards Kusum umpirsky wrote: > > Can you please explain on this example > > resources.router.routes.articlename.type = "Zend_Controller_Router_Route" > resources.router.routes.articlename.route = ":categoryname/:articlename" > resources.router.routes.articlename.defaults.controller = "article" > resources.router.routes.articlename.defaults.action = "index" > resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+" > (works, takes me to article page) > > What is qqq? And, if route is ":categoryname/:articlename", in my app if I > don't put default value for each :param in the route, I get exception - > says > param is required. > > My example: > > resources.router.routes.car.route = "/oglas/:title/:id" > resources.router.routes.car.defaults.module = "default" > resources.router.routes.car.defaults.controller = "search" > resources.router.routes.car.defaults.action = "view" > resources.router.routes.car.defaults.title = "" > resources.router.routes.car.defaults.id = "0" > > wont work without last 2 lines. > > Regards, > Saša Stamenković > > > On Fri, Dec 18, 2009 at 4:03 AM, Mon Zafra wrote: > >> A few things: >> >> * Make sure your route names are unique. I see two each of the 'articles' >> and 'articlenew' routes. >> * Remember that the last route defined will be the tried first, so put >> the >> more specific routes after the more generic ones. >> * The keys of the reqs array should match a parameter name, otherwise >> they're useless. >> >>-- Mon >> >> >> >> On Fri, Dec 18, 2009 at 5:59 AM, kusum wrote: >> >>> >>> Hi >>> i have made various rules for paths... >>> All of them work individually but when i place them together some don't >>> work. >>> if i change their order some other stops to work. >>> >>> My application.ini file has rules in this order:- >>> >>> resources.router.routes.categoryname.type = >>> "Zend_Controller_Router_Route" >>> resources.router.routes.categoryname.route = ":categoryname" >>> resources.router.routes.categoryname.defaults.controller = "category" >>> resources.router.routes.categoryname.defaults.action = "index" >>> resources.router.routes.categoryname.reqs.categoryname = "[a-z0-9-]+" >>> (works, takes me to category page) >>> >>> resources.router.routes.articlename.type = >>> "Zend_Controller_Router_Route" >>> resources.router.routes.articlename.route = ":categoryname/:articlename" >>> resources.router.routes.articlename.defaults.controller = "article" >>> resources.router.routes.articlename.defaults.action = "index" >>> resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+" >>> (works, takes me to article page) >>> >>> resources.router.routes.user.type = "Zend_Controller_Router_Route" >>> resources.router.routes.user.route = "user" >>> resources.router.routes.user.defaults.controller = "user" >>> resources.router.routes.user.defaults.action = "index" >>> resources.router.routes.user.reqs.username = "[a-z0-9-]+" >>> (works, takes me to user page) >>> >>> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" >>> resources.router.routes.articlenew.route = ":categoryname/new" >>> resources.router.routes.articlenew.defaults.controller = "category" >>> resources.router.routes.articlenew.defaults.action = "new" >>> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" >>> (works, but takes me to wrong page that is article page instead of new >>> category page) >>> >>> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" >>> resources.router.routes.articlenew.route = ":categor/:articl/edit" >>> resources.router.routes.articlenew.defaults.controller = "article" >>> resources.router.routes.articlenew.defaults.action = "edit" >>> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" >>> (works, takes me to edit page) >>> >>>
Re: [fw-general] Route Rewrite Problem
Thanks Mon, Yes that was my mistake of giving duplicate names... and changing them resolved my problem... And all rules work good now =) Regards Kusum Mon Zafra wrote: > > A few things: > > * Make sure your route names are unique. I see two each of the 'articles' > and 'articlenew' routes. > * Remember that the last route defined will be the tried first, so put the > more specific routes after the more generic ones. > * The keys of the reqs array should match a parameter name, otherwise > they're useless. > >-- Mon > > > On Fri, Dec 18, 2009 at 5:59 AM, kusum wrote: > >> >> Hi >> i have made various rules for paths... >> All of them work individually but when i place them together some don't >> work. >> if i change their order some other stops to work. >> >> My application.ini file has rules in this order:- >> >> resources.router.routes.categoryname.type = >> "Zend_Controller_Router_Route" >> resources.router.routes.categoryname.route = ":categoryname" >> resources.router.routes.categoryname.defaults.controller = "category" >> resources.router.routes.categoryname.defaults.action = "index" >> resources.router.routes.categoryname.reqs.categoryname = "[a-z0-9-]+" >> (works, takes me to category page) >> >> resources.router.routes.articlename.type = "Zend_Controller_Router_Route" >> resources.router.routes.articlename.route = ":categoryname/:articlename" >> resources.router.routes.articlename.defaults.controller = "article" >> resources.router.routes.articlename.defaults.action = "index" >> resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+" >> (works, takes me to article page) >> >> resources.router.routes.user.type = "Zend_Controller_Router_Route" >> resources.router.routes.user.route = "user" >> resources.router.routes.user.defaults.controller = "user" >> resources.router.routes.user.defaults.action = "index" >> resources.router.routes.user.reqs.username = "[a-z0-9-]+" >> (works, takes me to user page) >> >> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" >> resources.router.routes.articlenew.route = ":categoryname/new" >> resources.router.routes.articlenew.defaults.controller = "category" >> resources.router.routes.articlenew.defaults.action = "new" >> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" >> (works, but takes me to wrong page that is article page instead of new >> category page) >> >> resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" >> resources.router.routes.articlenew.route = ":categor/:articl/edit" >> resources.router.routes.articlenew.defaults.controller = "article" >> resources.router.routes.articlenew.defaults.action = "edit" >> resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" >> (works, takes me to edit page) >> >> resources.router.routes.articles.type = "Zend_Controller_Router_Route" >> resources.router.routes.articles.route = "user/activate/:userId/:accode" >> resources.router.routes.articles.defaults.controller = "user" >> resources.router.routes.articles.defaults.action = "activate" >> resources.router.routes.articles.reqs.username = "[a-z0-9-]+" >> (works, takes me to user page but takes wrong values) >> Array ( [controller] => user [action] => activate [45] => >> 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default ) >> it should be >> Array ( [controller] => user [action] => activate [userId] => 45 [accode] >> => >> 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default ) >> >> resources.router.routes.articles.type = "Zend_Controller_Router_Route" >> resources.router.routes.articles.route = "user/:act" >> resources.router.routes.articles.defaults.controller = "user" >> resources.router.routes.articles.defaults.action = "index" >> resources.router.routes.articles.reqs.qqq = "[a-z0-9-]+" >> (works, takes me to user page) >> >> >> Now if i move not working one down it starts working but some other stops >> working >> >> Is there any specific sequence to order rules... >> >> PLease help. >> >> Regards >> Kusum >> -- >> View this message in context: >> http://n4.nabble.com/Route-Rewrite-Problem-tp974415p974415.html >> Sent from the Zend Framework mailing list archive at Nabble.com. >> > > -- View this message in context: http://n4.nabble.com/Route-Rewrite-Problem-tp974415p976403.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Route Rewrite Problem
Hi i have made various rules for paths... All of them work individually but when i place them together some don't work. if i change their order some other stops to work. My application.ini file has rules in this order:- resources.router.routes.categoryname.type = "Zend_Controller_Router_Route" resources.router.routes.categoryname.route = ":categoryname" resources.router.routes.categoryname.defaults.controller = "category" resources.router.routes.categoryname.defaults.action = "index" resources.router.routes.categoryname.reqs.categoryname = "[a-z0-9-]+" (works, takes me to category page) resources.router.routes.articlename.type = "Zend_Controller_Router_Route" resources.router.routes.articlename.route = ":categoryname/:articlename" resources.router.routes.articlename.defaults.controller = "article" resources.router.routes.articlename.defaults.action = "index" resources.router.routes.articlename.reqs.qqq = "[a-z0-9-]+" (works, takes me to article page) resources.router.routes.user.type = "Zend_Controller_Router_Route" resources.router.routes.user.route = "user" resources.router.routes.user.defaults.controller = "user" resources.router.routes.user.defaults.action = "index" resources.router.routes.user.reqs.username = "[a-z0-9-]+" (works, takes me to user page) resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" resources.router.routes.articlenew.route = ":categoryname/new" resources.router.routes.articlenew.defaults.controller = "category" resources.router.routes.articlenew.defaults.action = "new" resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" (works, but takes me to wrong page that is article page instead of new category page) resources.router.routes.articlenew.type = "Zend_Controller_Router_Route" resources.router.routes.articlenew.route = ":categor/:articl/edit" resources.router.routes.articlenew.defaults.controller = "article" resources.router.routes.articlenew.defaults.action = "edit" resources.router.routes.articlenew.reqs.username = "[a-z0-9-]+" (works, takes me to edit page) resources.router.routes.articles.type = "Zend_Controller_Router_Route" resources.router.routes.articles.route = "user/activate/:userId/:accode" resources.router.routes.articles.defaults.controller = "user" resources.router.routes.articles.defaults.action = "activate" resources.router.routes.articles.reqs.username = "[a-z0-9-]+" (works, takes me to user page but takes wrong values) Array ( [controller] => user [action] => activate [45] => 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default ) it should be Array ( [controller] => user [action] => activate [userId] => 45 [accode] => 6ed38d3abc73818209ef10251e45ca32ba95f09c [module] => default ) resources.router.routes.articles.type = "Zend_Controller_Router_Route" resources.router.routes.articles.route = "user/:act" resources.router.routes.articles.defaults.controller = "user" resources.router.routes.articles.defaults.action = "index" resources.router.routes.articles.reqs.qqq = "[a-z0-9-]+" (works, takes me to user page) Now if i move not working one down it starts working but some other stops working Is there any specific sequence to order rules... PLease help. Regards Kusum -- View this message in context: http://n4.nabble.com/Route-Rewrite-Problem-tp974415p974415.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with Zend_translate
Thanks to all the suggestions... I read all and tried them... Finally my translate worked with. application.ini :- resources.translate.data = APPLICATION_PATH "/languages" resources.translate.adapter = "array" resources.translate.locale = "nl" resources.translate.options.scan = "filename" resources.translate.options.logUntranslated = true i made three files in languages folder :- en.php,nl.php,fr.php each had the required translation for eg en.php 'application', ); ?> and nl.php 'applicatie', ); ?> then when i tried _("application"); ?> in one of my files with locale en it showed :- application with locale nl it showed :- applicatie This all is wonderfull :clap: Just one last request :- we can set the default translator for forms by $tr = Zend_Registry::get('Zend_Translate'); Zend_Registry::set('tr', $tr); Zend_Form::setDefaultTranslator($tr); but by this $tr we are able to do translation just for forms If i need to use it for any messages i have to write echo Zend_Registry::get('Zend_Translate')-> Is there any other way to setDefaultTranslator for the whole application at one place ??? Thanks and Regards Kusum -- View this message in context: http://old.nabble.com/Problem-with-Zend_translate-tp26400093p26443621.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with Zend_translate
Thanks to all the suggestions... I read all and tried them... Finally my translate worked with. application.ini :- resources.translate.data = APPLICATION_PATH "/languages" resources.translate.adapter = "array" resources.translate.locale = "nl" resources.translate.options.scan = "filename" resources.translate.options.logUntranslated = true i made three files in languages folder :- en.php,nl.php,fr.php each had the required translation for eg en.php 'application', ); ?> and nl.php 'applicatie', ); ?> then when i tried _("application"); ?> in one of my files with locale en it showed :- application with locale nl it showed :- applicatie This all is wonderfull :clap: Just one last request :- we can set the default translator for forms by $tr = Zend_Registry::get('Zend_Translate'); Zend_Registry::set('tr', $tr); Zend_Form::setDefaultTranslator($tr); but by this $tr we are able to do translation just for forms If i need to use it for any messages i have to write echo Zend_Registry::get('Zend_Translate')-> Is there any other way to setDefaultTranslator for the whole application at one place ??? Thanks and Regards Kusum -- View this message in context: http://old.nabble.com/Problem-with-Zend_translate-tp26400093p26443620.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Problem with Zend_translate
I am trying to use zend_Translate for translation in my application but it is not working :-(( I am using en.mo and en.po files for translation in my lang folder In my application.ini i am using resources.translate.registry_key = "Zend_Translate" resources.translate.adapter = "gettext" resources.translate.data.directory = APPLICATION_PATH "/lang/" resources.translate.disableNotices = false resources.translate.options.scan= "filename" resources.translate.options.logUntranslated = true resources.translate.data.fileExt= "php" resources.translate.locale = "en_US" in my Bootstrap.php my initialisation function goes as protected function _initTranslation() { $this->bootstrap('translate'); $tr = $this->getResource('translate'); Zend_Registry::set('tr', $tr); Zend_Form::setDefaultTranslator($tr); print_r($tr->getList()); } And when i am trying to print this _('Register'); ?> it gives me an error Uncaught exception 'Zend_Translate_Exception' with message 'Error opening translation file 'Array'.' in C:\wamp\www\photoshop\library\Zend\Translate\Adapter\Gettext.php:85 Stack trace: #0 C:\wamp\www\photoshop\library\Zend\Translate\Adapter.php(464): Zend_Translate_Adapter_Gettext->_loadTranslationData(Array, 'en_US', Array) #1 C:\wamp\www\photoshop\library\Zend\Translate\Adapter.php(207): Zend_Translate_Adapter->_addTranslationData(Array, 'en_US', Array) #2 C:\wamp\www\photoshop\library\Zend\Translate\Adapter.php(112): Zend_Translate_Adapter->addTranslation(Array, 'en_US', Array) #3 C:\wamp\www\photoshop\library\Zend\Translate\Adapter\Gettext.php(51): Zend_Translate_Adapter->__construct(Array, 'en_US', Array) #4 C:\wamp\www\photoshop\library\Zend\Translate.php(93): Zend_Translate_Adapter_Gettext->__construct(Array, 'en_US', Array) #5 C:\wamp\www\photoshop\library\Zend\Translate.php(71): Zend_Translate->setAdapter('gettext', Array, 'en_US', Array) #6 C:\wamp\www\photoshop\library\Zend\Application\Resource\Tra in C:\wamp\www\photoshop\library\Zend\Translate\Adapter\Gettext.php on line 85 I am not getting the reason of the problem.:confused: Please Help Thanks Kusum -- View this message in context: http://old.nabble.com/Problem-with-Zend_translate-tp26400093p26400093.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Route Rewrite not working...
Dear All, I am new to zend framework got stuck in a problem... i have some navigation links on my main page... My url goes like http://localhost:8001/photoshop/public/ and on my page i have link as article/index/sss navigation here article is my controller,success is action and sss is any random articlename which i have to use in my controller in my config.ini i am using the rewrite code as: - routes.archive.route = "article/success/:articlename/*" routes.archive.defaults.controller = article routes.archive.defaults.action = success routes.archive.defaults.article = add WHen i click on link it takes me to correct url like http://localhost:8001/photoshop/public/article/success/sss but when i get params there i dont get any parameter its empty array Now i am not sure if i am doing it all correct May be i need to add anything It would be realy great if anyone can help Regards Kusum -- View this message in context: http://www.nabble.com/Route-Rewrite-not-working...-tp24521703p24521703.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Route Rewrite not working...
Dear All, I am new to zend framework got stuck in a problem... i have some navigation links on my main page... My url goes like http://localhost:8001/photoshop/public/ and on my page i have link as 'article/index/sss navigation here article is my controller,success is action and sss is any random articlename which i have to use in my controller in my config.ini i am using the rewrite code as: - routes.archive.route = "article/success/:articlename/*" routes.archive.defaults.controller = article routes.archive.defaults.action = success routes.archive.defaults.article = add WHen i click on link it takes me to correct url like http://localhost:8001/photoshop/public/article/success/sss but when i get params there i dont get any parameter its empty array Now i am not sure if i am doing it all correct May be i need to add anything It would be realy great if anyone can help Regards Kusum -- View this message in context: http://www.nabble.com/Route-Rewrite-not-working...-tp24521654p24521654.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Route Rewrite not working...
Dear All, I am new to zend framework got stuck in a problem... i have some navigation links on my main page... My url goes like http://localhost:8001/photoshop/public/ and on my page i have link as article/success/sss >navigation here article is my controller,success is action and sss is any random articlename which i have to use in my controller in my config.ini i am using the rewrite code as: - routes.archive.route = "article/success/:articlename/*" routes.archive.defaults.controller = article routes.archive.defaults.action = success routes.archive.defaults.article = add WHen i click on link it takes me to correct url like http://localhost:8001/photoshop/public/article/success/sss but when i get params there i dont get any parameter its empty array Now i am not sure if i am doing it all correct May be i need to add anything It would be realy great if anyone can help Regards Kusum -- View this message in context: http://www.nabble.com/Route-Rewrite-not-working...-tp24505415p24505415.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Captcha image not appearing
i am using this code to add captcha to my page if (!isset($this->session->passedRegisterCaptcha) || !$this->session->passedRegisterCaptcha) { //if we have set captcha in the session for this request - use it, else generate new one if (isset($this->session->registerCaptcha)) { $captchaCode = $this->session->registerCaptcha; } else { $md5Hash = md5($_SERVER['REQUEST_TIME']); $captchaCode = substr($md5Hash, rand(0, 25), 5); $this->session->registerCaptcha = $captchaCode; } $captcha = new Zend_Form_Element_Text('captcha'); $captcha->setLabel('Enter the text') ->addValidator(new Zend_Validate_Identical($captchaCode)) ->addValidator($validatorNotEmpty, true)->setRequired(true); $captchaDecorator = new My_Form_Decorator_Captcha(); $captchaDecorator->setOption('namespace', 'User')->setOption('captchaId', 'registerCaptcha'); $captchaDecorator->setTag('div'); $captcha->addDecorator($captchaDecorator); $form->addElement($captcha); } i am not getting the captcha image but getting an error Strict Standards: Creating default object from empty value in C:\wamp\www\new\application\modules\default\controllers\UserController.php on line 150 and line 150 states :- $this->session->registerCaptcha = $captchaCode ; Please help. Regards Kusum -- View this message in context: http://www.nabble.com/Captcha-image-not-appearing-tp24414072p24414072.html Sent from the Zend Framework mailing list archive at Nabble.com.