language prefix routing

2012-09-03 Thread Deividas Juškevičius
 

What I'm trying to achieve is that I can change only language prefix in the 
url, but getting problems... There is my routes:

$lang_regexp = implode('|', Configure::read('Config.languages'));
Router::connect('/', array('controller' = 'languages', 'action' = 'choose'));
Router::connect('/:lang/:controller/:action/*',
   array(),
   array('lang' = $lang_regexp));


// actual default page; can be any controller
Router::connect('/:lang/pages/ajax_newsletter', array('controller' = 
'pages', 'action' = 'ajax_newsletter'));
Router::connect('/:lang/',
array('controller' = 'pages', 'action' = 'index',  'home'),
array('lang' = $lang_regexp));
Router::connect('/:lang/:slug', array('controller' = 'pages', 'action' = 
'pages'), array('lang' = $lang_regexp));
Router::connect('/:slug', array('controller' = 'pages', 'action' = 
'pages'), array('lang' = $lang_regexp));

Router::connect('/:lang/special_offers', array('controller' = 'pages', 
'action' = 'offers'));
Router::connect('/:lang/special_offers/*', array('controller' = 'pages', 
'action' = 'offers_city'));
Router::connect('/:lang/news/*', array('controller' = 'pages', 'action' = 
'news_article'));
Router::connect('/:lang/news', array('controller' = 'pages', 'action' = 
'news'));
Router::connect('/:lang/:slug/:id/*', array('controller' = 'pages', 
'action' = 'offers'), array('lang' = $lang_regexp));

Router::connect('/cities/select', array('controller' = 'cities', 'action' 
= 'select'));
Router::connect('/cities/select/*', array('controller' = 'cities', 
'action' = 'select'));

my language switcher:

$this-html-link($this-html-image('flag_ru.gif',  array(alt=, 
width=14px, height=12px, title=)), array(lang = rus), 
array('escape' = false));

:lang/:slug is menu entry so if I have menu like localhost/eng/contactafter 
language change I get 
localhost/rus/pages/pages... How to change only language prefix?

-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




afterDelete question

2009-02-25 Thread Deividas

I have two controller's, for example Members and MemberPictures, when
I delete Member i want MemberPicture also deleted, i have set
MemberPictures dependable in Member model, but I also want to unlink
actual picture from the file system. I've tried using afterDelete() in
MemberPicture model, but it doesn't seem to be called when i delete
Member. Maybe I am doing something wrong?

p.s
sorry for my bad english :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake Cheatsheet.pdf 1.1 - Anyone still have it?

2009-02-25 Thread Deividas

Maybe this? http://www.scribd.com/doc/41728/cakesheet

On Feb 25, 11:13 am, villosil villo...@gmail.com wrote:
 Hi, I'm looking for the 1.1 cheatsheet in pdf and I can't find it. If
 anyone could sent it to me or say where can I find it.

 Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---