Re: Translate behaviour / Save multiple languages at once

2012-12-24 Thread matthieu . riolo
Hey

The translate behaviour seems to be quite bad documented.

If you want to work with it correctly, you've to mind to set the locale 
attribute:

$this->Yourmodel->locale = false; //storing multiple languages at once
$this->Yourmodel->locale = null; //will use the locale in your conf
$this->Yourmodel->locale = 'any string you that you makes happy';//custom 
one

if you save or retrieve the data you've to set that attribute!


greetz


Am Samstag, 1. Dezember 2012 16:29:56 UTC+1 schrieb LDSign:
>
> Hi
>
> Ive searched for several hours now and unfortunatly the translate 
> behaviour does not work as expected. I try to save multiple translation 
> fields at once like so:
>
> echo $this->Form->adminText('name.deu',__('Name german'));
>> echo $this->Form->adminText('name.eng',__('Name english'));
>>
>
>  My controller (save)action is unmodified from the one baked. In the model 
> Ive correctly included the translate behaviour:
>
> public $actsAs = array('Translate' => array('name'));
>>
>
> Cake-Version is 2.2.3 
>
> So what happens? I expect that the two name fields would be saved to the 
> i18n table under their corresponding langauge after transmitting the form. 
> But instead of this only the (actual) language stored in the session will 
> be used...so only one language-entry is added to the i18n table and the 
> other language will be completly ignored.
>
> After searching the net several people had success with the approach shown 
> above, but on my side it doesn't work. What I am doing wrong? Is this a bug?
>
> Thank you for your help.
>
> Greetings,
> Frank
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.




Re: Problem with savefield method and phpmyadmin, strange behavior

2010-11-25 Thread matthieu
Thank you for your help John, unfortunately this doesn't solve my
problem.

Here is the complete code:

$array =array('150'=>'channel150', '151'=>'channel151');
foreach ($array as $channel => $chan_name)
{

$this->Channel->create();
$this->Channel->id = $channel;
$this->Channel->saveField('is_first_transfer', 0, 
false);
}


What is strange is that if I do a find just after, and see the result
with debug, it tells me the value changed to 0, but it is not the case
in phpmyadmin !?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Problem with savefield method and phpmyadmin, strange behavior

2010-11-25 Thread matthieu


It is me again.

I thought there might be a problem with with my "0" value, but that's
not it, I tried to change the value from 1 to 2 instead of 0, and it
does the same. One value changes, not the other

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Problem with savefield method and phpmyadmin, strange behavior

2010-11-25 Thread matthieu
Hello

I'm doing this inside a loop:

$this->Channel->create();
$this->Channel->id = $channel;
$this->Channel->saveField('is_first_transfer', '0')

I'm inside a loop, so the value of $channel change each time...

The problem is that even though a debug of the Channel table shows me
that the  "is_first_transfer" value was changed to 0, in phpmyadmin
the value remains "1",  I don't understand quite well wha'ts happening
here... I tried with updateAll and it does the same, I tried with and
without the "create()" before the save, and it does the same...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Savefield won't work, or randomly...

2010-10-25 Thread matthieu
Thank you so much, I was blocked with this since this morning, it
works perfectly thanks

On Oct 25, 1:09 pm, Tilen Majerle  wrote:
> instead of this use:
>
>  $data = array(
> "ChannelsTwitterId" => array(
> "id" => $find_id,
>  "last_twitt_id" => $last_twitt_id
> )
> );
>  $this->ChannelsTwitterId->save($data, false); //without validation
> --
> Tilen Majerlehttp://majerle.eu
>
> 2010/10/25 matthieu 
>
> > Hello everyone;
>
> > Savefield doesn't work, I don't know why, here is the code
>
> >        $this->ChannelsTwitterId->id = $find_id;
> >        $this->ChannelsTwitterId->saveField('last_twitt_id',
> > $last_twitt_id);
>
> > I test the values $finnd_id and $last_twitt_id juste before and they
> > are correct... and there is no mistake in 'ChannelsTwitterId'.
>
> > my $last_twitt_id is a string of numbers, I tried making it an
> > integer, but it still doesn't work...
>
> > The structure of the colomn in mysql:  varchar(50) utf8_bin
>
> > Did someone have the same problem?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Savefield won't work, or randomly...

2010-10-25 Thread matthieu
Hello everyone;

Savefield doesn't work, I don't know why, here is the code

$this->ChannelsTwitterId->id = $find_id;
$this->ChannelsTwitterId->saveField('last_twitt_id', $last_twitt_id);

I test the values $finnd_id and $last_twitt_id juste before and they
are correct... and there is no mistake in 'ChannelsTwitterId'.

my $last_twitt_id is a string of numbers, I tried making it an
integer, but it still doesn't work...

The structure of the colomn in mysql:  varchar(50) utf8_bin

Did someone have the same problem?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Creating a plugin

2010-10-15 Thread matthieu
Hello

I've added a simple plugin, I added a folder named "twitter" in
plugin. In it I added a twitter_app_controller.php,
twitter_app_model.php and a file named "controllers" with the
twitter_controller.php in it.  (the models and views folder are
empty).

Problem: I have a function in my controller, I want to call it with
its url, it works, but I don't want the layout of my website, I only
want the blank page and the results of my debug in it...

I hope my request is not too unclear (sorry english is not my first
language).

Thank you for taking the time to read me if you've read so far :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Poll: what do you hate about CakePHP?

2009-05-08 Thread Matthieu Sadouni

Nothing I hate but one thing I find is really lacking, one that would
facilitate sharing code (pl and one that would ease development.

Really lacking to me are objects for objects instead of arrays in the
models, for example a People->find('all') would return objects on
which you can call methods : $person->fullName(). It's currently the
only thing I find is a real problem when your app starts growing and
you add more logic in your models. Currently if you need to manipulate
your data before displaying you have to either do it in the view which
is ugly or find a way to pass your data array back to a model static
function, determine if you got all the data you need in the given
array and return you result.. Considering find methods return the data
in a different form depending on wether you did a find('first') or find
('all'), how the models are linked, or the fact that you could just
have an id and not the full data it's quite a pain. Felix's
AppModel::normalize (http://debuggable.com/posts/normalizing-cakephp-
model-records:48b7ed7f-9498-4b9c-8734-6f014834cda3) is a clever way to
do it and what I use right now but I think objects are the right next
step to clean code and reusability.

What would facilitate sharing code is a simplification of plugin
system, right now it works but is a bit complicated to set up and use,
which I think explains the relatively low amount of plugins available
on the Bakery and elsewhere. Compare this to the Rails world where
virtually every shared code is in plugin form : it's easy to integrate
in your app and stay up to date with a simple svn:externals or git
submodule. When you grab a component or datasource on the bakery you
have to copy and paste it in your app and updating later is kinda
difficult, especially if you use it in several apps. Having easy to
create and use plugins would facilitate the sharing of code and I
think speed up the growth of the framework's ecosystem. I guess this
plugin thing ain't that easy because as far as I know PHP lacks the
module system from Ruby which lets you inject code into existing
classes, easing the creation of plugins that can do almost anything.
But maybe there's another solution to that or the new namespaces will
help.

Last thing I think would help greatly is a full fledged console in
which you can instanciate objects, test your models and controllers
without the need to debug() and log() in a view. You can already do
cool stuff with the actual console but for example you can't (or I
don't know how) test a model method or a save, you can only do finds.
I use this all the time when working with Rails (I use both
frameworks) and it's really nice to quickly check something in your
code.

Well besides those that's all, nothing to hate about Cake really it's
an awesome tool. Thanks for gathering feedback, looking forward to see
what's coming out of all these ideas people post.

Do you plan on posting the results somewhere so we can grab stuff we
really care about and work on integrating it once it's been decided it
would be added to the core ?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Form Helper, default value

2009-03-10 Thread Matthieu

Hi!

Id like to choose a default value for this form element et I dont know
how? (exemple: defautl value: 01-01-1980 of Day-Month-YearÉ

echo $form->input('birthdate', array('dateFormat' => 'DMY',
'timeFormat' => 'none', 'minYear' => date('Y') - 100, 'maxYear' => date
('Y') - 6));

thks
--~--~-~--~~~---~--~~
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: Include Javascript code for one specific view. how to?

2009-03-04 Thread Matthieu

excellent, thks a lot!

On Mar 5, 6:46 pm, brian  wrote:
> As long as you have $scripts_for_layout in the head of your layout file:
>
> echo $javascript->link('some_file_without_extension', false);
>
> The second param tells Cake not to write the script tag in the body
> (even though you're echoing), but instead pass it to
> $scripts_for_layout (the view is rendered before the layout wrapper).
>
> If you want a code block:
>
> echo $javascript->codeBlock($code, array('inline' => false));
>
> Set 'inline' to true if you want the code block printed in your view
> instead of the head.
>
> On Thu, Mar 5, 2009 at 12:40 AM, Matthieu  
> wrote:
>
> > How, I dont know how to include a js file or code for one specific
> > view. The only way I found to include js files is to do it in the
> > layout..
>
> > Thks for the help
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Include Javascript code for one specific view. how to?

2009-03-04 Thread Matthieu

How, I dont know how to include a js file or code for one specific
view. The only way I found to include js files is to do it in the
layout..

Thks for the help
--~--~-~--~~~---~--~~
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: lifetime session variable

2009-02-04 Thread Matthieu

thks, I checked inside the core file, I didnt see it, but I should
have been more persistent, I  just found it, thks!

On 5 fév, 00:32, RodrigoRM  wrote:
> http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables
>
> On Feb 4, 9:30 am, Matthieu  wrote:
>
> > Hi, I'd like to change the lifetime of a session variable to 30
> > minutes for example,
>
> > how can you do it? thks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



lifetime session variable

2009-02-04 Thread Matthieu

Hi, I'd like to change the lifetime of a session variable to 30
minutes for example,

how can you do it? thks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Jquery or Scriptalicious?

2008-10-30 Thread Matthieu

Hello,

I'm gonna create a web app using CakePHP but I'm confused about
chosing between Jquery or Scriptalious? Which one should I choose?
Does it really matter? What's the differences between them?

tks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



need your help - project model

2008-10-23 Thread Matthieu

Hi everybody,

I'm planning to make a web application, it's a kind of a social
network. Would you know some guidelines to make this app from A to Z.
Shall I start with the design, the data base or the php classes? Would
you know a well-known model about it because I don't know where to
start actually?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHP Editor

2008-10-20 Thread Matthieu

Thanks guys for your help!

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



PHP Editor

2008-10-19 Thread Matthieu

Hello, I'd like to know which project editor you would recommend. I'm
planning to make a web application using the CakePHP framework.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---