Internationalization & Localization in Cakephp switching languages

2015-08-05 Thread yusuf elhirar
Hello guys, 
I started to make a website in 3 different languages: French, English and 
Arabic. Therefore, I would like to know how to switch language and using a 
link in the view. I already extract PO file for French and configure the 
website for French (on the bootstrap file), but I want to know how to show 
the switching links. 
Thanks for everyone tries to help me with.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Admin as a plugin

2013-01-01 Thread Yusuf Abdulla Shunan

>
> You can use the admin section as a plugin, something like: 
> https://github.com/Maldicore/Admin
>
> Regards
>
>

-- 
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: Admin Section as plugin

2013-01-01 Thread Yusuf Abdulla Shunan
You can use the admin section as a plugin, something like: 
https://github.com/Maldicore/Admin

Regards

-- 
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: cakephp admin app

2013-01-01 Thread Yusuf Abdulla Shunan
You can use the admin section as a plugin, something like: 
https://github.com/Maldicore/Admin

Regards

-- 
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: How to add multiple rows in one time ?

2010-09-01 Thread Yusuf Widiyatmono
you can use saveAll
$this->Eating->saveAll($data['Eating']);
please read saveAll from the api.


Yusuf Widiyatmono

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


XML to Array

2010-08-26 Thread Yusuf Widiyatmono
hi there..

i have an xml file which was generated by me from an array by cakephp
function xml->compose(true)

























now how can i turn it back to array?

i tried to use, $array =  Set::reverse(new Xml('myfle.xml'));
but the result just give me one index of array like this..

Array
(
[Category] => Array
(
[id] => 255
[name] => accomodation
[relation] => 5
[Concept] => Array
(
[id] => 337
[name] => tokyo
)

)

)

as you can see, the concept just only one there..
any help please?

thanks before,


Widi

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: Cakephp - Editing HABTM Models

2010-06-27 Thread Yusuf Widiyatmono
i'm using an extension by Brandon Praise; the extension's name is
ExtendAssosiationsBehavior which is easy to use to edit, delete or add entry
to HABTM related models.

http://bakery.cakephp.org/articles/view/add-delete-habtm-behavior

hope helps...

On Sun, Jun 27, 2010 at 5:49 PM, Rami  wrote:

> Hi All,
>
> I am a cakephp beginner and I need your support regarding an issue
> with updating HABTM models.
>
> I noticed a weird behavior that cakephp is doing which is deleting all
> old rows and inserting new ones whenever and HABTM model is edited. I
> read in the cookbook that this how it is, and I read that there is a
> 'unique' attribute which is considered as a flag for this 'delete old
> - insert new' process.
>
> Is there anyway one can overcome this? The problem is that the id of
> the join table itself, is used as a foreign key in other tables that's
> why it cannot be deleted. I was thinking of saving the rows at the
> beginning, removing the association on the fly and then inserting the
> data (the old ones which weren't deselected and the new selected ones)
> manually.
>
> Any ideas?
>
> Thanks,
> Rami.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
http://www.wmonou.com

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: Error 404

2009-02-23 Thread yusuf widi
have you activated the apache mod_rewrite? the directory for cake
application also have to be AllowOveride to All.

On Tue, Feb 24, 2009 at 6:51 AM, jc_mich  wrote:

>
>
> Hi
> I created an application according to MVC rules, my .htaccess files look
> like the specifications in
>
> http://bakery.cakephp.org/articles/view/500-errors-with-1and1-hosting-apache-1-x
> Errors with Hosting Apache  but it doesn't work when I try to access it,
> the
> server display a 404 error.
>
> If I write http://server/app/index?url=users/login, it looks fine.
>
> What I did wrong? Is there someone who had the same problem?
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/Error-404-tp22170947p22170947.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
>
> >
>


-- 
http://www.wmonou.com

--~--~-~--~~~---~--~~
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: Top 10 Framework

2009-02-02 Thread yusuf widi
Ok guyz... thanks for response. I think that website is only accessories
only for us. :)

On Tue, Feb 3, 2009 at 3:18 AM, ache...@gmail.com  wrote:

>
> And now the site has been completely F'ed. It looks like they aren't
> sanitizing their data (shame on them) and now people have figured out
> that you can post whatever you want in there as a review. "I liked
> cake for 500 stars." Look at the average, 5.3 means people are gaming
> it. So, don't worry about it, it's just a website with a huge bug that
> allows anyone do manipulate the crap out of the numbers. So go out and
> use firebug or your favorite tool to post whatever you want to their
> site, with under 30 posts to their site you could tank every framework
> but one and set the one you like to be 500 stars avg. rating.
>
> I'm going to make a brash assumption and say that this site is written
> in pure php rather than a framework (or if it is a framework that
> doesn't sanitize then the framework sucks and isn't worth anything).
> So the only thing we can take away from this is this:
>
> * Use a framework, it's better than nothing
> * This is a good place to find a list of other frameworks to try
> * The numbers don't mean anything so any bad reviews/good reviews
> could be bogus so just try them all
>
> Just my 0.02$
>
> Sincerely,
> ~Andrew Allen
>
> On Feb 2, 10:39 am, Martin Westin  wrote:
> > @sunertl
> > I was refering more to the website you linked to than to your post.
> >
> > I really liked this guy:
> > "It is poorly written. Just look at those lengthy functions."
> > Say what?
> >
> > And Cake is off the list... all the top ones new "un-heard-of"
> > frameworks :)
> > But look at the id's.
> >
> > Zend is id 1 (quite natural to start with that one)
> > Cake is 2...http://www.phpframeworks.com/php-frameworks/index.php?id=2
> >
> > Make of that what you will.
> >
> > On Feb 2, 3:46 pm, sunertl  wrote:
> >
> > > Oh, if is seemed I cried jihad, i made something wrong! Maybe because
> > > english is not my primary language...
> > > To be honest I do not give a  about the rank of a framework or
> > > another. I use rankings like the mentioned one to look what is new in
> > > the field of frameworks. This way I discovered Yii and I like it. For
> > > small projects it seems a pretty good choice but for larger ones
> > > nothing beats Cake imho.
> >
> > > I really hate those "my-os-is-better, my-framework-is-cooler, my-
> > > browser-is-safer"-discussions. everyone should test a few of the
> > > frameworks and use the one that fits his way of developing best.
> > > Rankings can only give you an overview.
> >
> > > On 2 Feb., 14:04, Martin Westin  wrote:
> >
> > > > Why do I hear the cries of Jihad every time I read about this vs that
> > > > framework :)
> >
> > > > If that website is a guide the the best framework, then these are the
> > > > very best short films and videos.
> http://www.youtube.com/browse?s=tr&c=0&l=&b=0
> >
> > > > You decide popularity by voting and popular is not always the same as
> > > > good.
> >
> > > > What I conclude is that Akelos have some very dedicated fans. That is
> > > > all.
> >
> > > > On Feb 2, 1:26 pm, sunertl  wrote:
> >
> > > > > I tested Yii for a while. It seems nice but not as fully featured
> as
> > > > > Cake. E.g. code generation is not even half as nice as in Cake -
> > > > > relations are made by hand in every model, controller, view. a
> little
> > > > > bit annoying. But it is fast as hell. I implemented a little
> project
> > > > > database which I also made in cake and (without optimizing the hell
> > > > > out of both frameworks) Yii kicks Cakes ass concerning speed of
> > > > > showing up a list of projects with data from a few related tables.
> > > > > BUT: the Yii implementation is only a subset of the Cake one as the
> > > > > latter is in use for over a year now and customized a LOT while the
> > > > > Yii is new and not very customized. So it is not an all fair
> > > > > competition.
> > > > > To round it up: I love Cake for the comfort in developing while Yii
> > > > > seems a little bit faster when the coding work is done.
> >
> > > > > On 2 Feb., 01:11, yusuf widi  wrote:
> >
> > > > > 

Top 10 Framework

2009-02-01 Thread yusuf widi
Hi guyz... i got this somewhere on the net...

http://www.phpframeworks.com/top-10-php-frameworks/

Why they put cake php on the fifth place? i dont think we were worse than
those framework... :)
does anyone here have already done some research with those framework's
which is have higher place than CakePHP?.

for me, i had only done some research with Zend and CodeIgniter.


Thanks.
-- 
http://www.wmonou.com

--~--~-~--~~~---~--~~
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: HABTM on a HABTM

2009-01-29 Thread yusuf widi
 array(
'className' => 'Area',
'foreignKey' => 'parent_id',
'dependent' => true
)
);

?>

this stuff works well with me...

On Thu, Jan 29, 2009 at 6:35 PM, AD7six  wrote:

>
>
>
> On Jan 29, 9:58 am, Miles J  wrote:
> > It seems that my belongsTo (it belongs to itself to get its parent
> > system) causes the crash/white page. Once I remove the belongsTo it
> > works, weird, no problem though.
> >
> > class System extends AppModel {
> >
> > /**
> >  * Reduce usage
> >  */
> > var $recursive = -1;
> >
> > /**
> >  * System belongs to a parent system
> >  */
> > var $belongsTo = array(
> > 'Parent' => array(
> > 'className' => 'System',
> > 'foreignKey' => 'parent_id'
> > )
> > );
>
> Model aliases must be unique system-wide. If you are using 'Parent'
> anywhere else to refer to a different model, that may cause a loop (in
> the class registry) and therefore a blank page.
>
> If that's not the case you have a loop somewhere else - best to debug
> and find out where. The core code is afterall, just php files.
>
> AD
> >
>


-- 
http://www.wmonou.com

--~--~-~--~~~---~--~~
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: XAMPP for linux

2009-01-29 Thread yusuf widi
xampp for linux can be find on apachefriend.com
but you know that ubuntu cd have already contains php, apache and mysql?

On Thu, Jan 29, 2009 at 8:44 PM, leo  wrote:

>
> try the xampp or ubuntu websites
>
> On Jan 29, 12:18 pm, Sergi Pasoev  wrote:
> > Hi!
> >
> > Plese, tell me where to download XAMPP for Ubuntu AMD 64.
> >
>


-- 
http://www.wmonou.com

--~--~-~--~~~---~--~~
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: CakePHP Model Advice

2009-01-28 Thread yusuf widi
no, it is ok if your ingredient model is empty...
try to give recursive parameter with '2' when you use find method. by
default recursive parameter is null.

read more about recursive is on the api.cakephp.org
http://api.cakephp.org/class/model#method-Modelfind


On Thu, Jan 29, 2009 at 4:46 AM, matth  wrote:

>
> Howdy,
> I'm having trouble fully wrapping my head around Cake's models. They
> seem great and I'm really working to figure out how to take advantage
> of all the benefits.
>
> However, I can't quite figure out how to set up my models
> appropriately. For example, I have two models (Recipe and Ingredient)
> and I have defined they following relationship in my Recipe model:
>
> var $hasAndBelongsToMany = array(
>'Ingredient' => array(
>'className' => 'Ingredient',
>'joinTable' => 'ingredients_recipes',
>'foreignKey' => 'recipe_id',
>'associationForeignKey' => 'ingredient_id',
>'unique' => true,
>)
> );
>
> But I'm not able to retrieve my ingredients. So what's the deal? Is
> something wrong with my table setup? Do I need to modify my Ingredient
> model (because it's empty)?
> >
>


-- 
http://www.wmonou.com

--~--~-~--~~~---~--~~
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: Closing $ajax->form()

2009-01-22 Thread Yusuf Widiyatmono
i use $form->end();

and it does submit trough ajax updater successfully.


see the code which is generated by ajax->form();
you will figure out that it just a normal new Ajax.Updater().


sometimes i meet my limitation when use ajax on cake, 
so i just write normal html and javascript on the view layer.




From: Pyrite 
To: CakePHP 
Sent: Friday, January 23, 2009 6:47:09 AM
Subject: Closing $ajax->form()


How do you put the close tag in a form created by $ajax->form() ?? Why
is there not an $ajax->formEnd() similar to the FormHelper's $form->end
() ?

Also, when I create a form with $ajax->form(), and I add a submit with
$ajax->submit(), it does not submit the form. A usage example would be
great. I can only get it to submit the form if I use $form->end
('Submit') instead of $ajax->submit().


  
--~--~-~--~~~---~--~~
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: How to submit form elements that are disabled?

2009-01-22 Thread Yusuf Widiyatmono
If the value of disabled form element could changed dynamically (maybe you have 
some lil process on your view), maybe you need some little javascript script 
here...


function test(){
document.ItemEdit.getElementById('ItemQuantytyHid').value = 
document.ItemEdit.getElementById('ItemQuantyty').value;
}


print $form->create('Item', 
array("action"=>"edit","onsubmit"=>"javascript:test();"));
print $form->input('Item.quantity', array("label"=>"Quantity", 
"disabled"=>"disabled");
print $form->hidden('Item.quantityHid');
print $form->end('Submit');

 
and then in your controller
you have to do this

if(!empty($this->data)){
$this->data['Item']['quantyty] = $this->data['Item']['quantytyHid];
$this->Item->save($this->data['Item']);
}

i have not tested this yet :P, but i think you could figure it out :)...

hope this help..





From: Dardo Sordi Bogado 
To: cake-php@googlegroups.com
Sent: Friday, January 23, 2009 9:39:28 AM
Subject: Re: How to submit form elements that are disabled?


> I want to have a form text input get submitted, but also want it to be
> disabled on display.

>From http://www.w3.org/TR/html401/interact/forms.html#h-17.12 :

...the INPUT element is disabled. Therefore, it cannot receive user
input nor will its value be submitted with the form.

you also need to add the field as hidden, so it's value will be posted.


> Eg. $form->input('frmInputQuantity', array('label'=>'Quantity:',
> 'disabled'=>'disabled'));
>
> This does not get submitted into $this->data. How can I change what
> gets posted to $this->data with the form helper?
>
>
> >
>



  
--~--~-~--~~~---~--~~
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: Dynamic Model Call

2009-01-21 Thread Yusuf Widiyatmono
the error is happen because i use variable as model name
$model_data = $this->AreaInfo->{$model_name}->find('list');

but although its give me error and stop the php compile on that ** line
its still could fetch data from that $model_name table..
that is why the $model_data have value when i try to print it.

my question is how to get rid this error?

sorry for my bad english before :)




From: brian 
To: cake-php@googlegroups.com
Sent: Thursday, January 22, 2009 2:10:17 PM
Subject: Re: Dynamic Model Call


I don't think I understand what your question is, then. Yes, you can
use a variable as the model name, if used the way I showed you. But,
where did this error come from? If it was from the find() line, how is
it that your array has data in it?

On Wed, Jan 21, 2009 at 11:22 PM, Yusuf Widiyatmono  wrote:
> sorry it just a mark for the code line.
>
> Fatal error: Cannot access empty property in
> {some_directories_path}\app\controllers\areas_controller.php on line **
>
> i mean that i got that message from this line
>
> $model_data = $this->AreaInfo->$model_name->find('list');**
>
>
>
>
>
> 
> From: brian 
> To: cake-php@googlegroups.com
> Sent: Thursday, January 22, 2009 1:06:39 PM
> Subject: Re: Dynamic Model Call
>
>
> What is on line** (from the error msg)?
>
> On Wed, Jan 21, 2009 at 10:37 PM, Yusuf Widiyatmono 
> wrote:
>> the model is loaded...
>> see the print_r result, the model can retrieve some data,
>> but in the end the error still appear and make the further logic die
>>
>>
>>
>> 
>> From: brian 
>> To: cake-php@googlegroups.com
>> Sent: Thursday, January 22, 2009 12:30:22 PM
>> Subject: Re: Dynamic Model Call
>>
>>
>> Are these models loaded?
>>
>> On Wed, Jan 21, 2009 at 6:10 PM, Yusuf Widiyatmono 
>> wrote:
>>> i did and it still shows me same errors...
>>>
>>>
>>> 
>>> From: brian 
>>> To: cake-php@googlegroups.com
>>> Sent: Thursday, January 22, 2009 2:49:31 AM
>>> Subject: Re: Dynamic Model Call
>>>
>>>
>>> Try $this->AreaInfo->{$model_name}->find(...)
>>>
>>> On Wed, Jan 21, 2009 at 12:33 AM, wmonou  wrote:
>>>>
>>>> Helo there i am trying to call model from a variable
>>>>
>>>> let say that i have a code is like this:
>>>>
>>>>// $model_name is a string
>>>>// bind necessary model
>>>>if(!empty($model_name)){
>>>>$this->AreaInfo->bindModel(
>>>>array(
>>>>'belongsTo'=>array(
>>>>$model_name => array(
>>>>'className' =>
>>>> $model_name,
>>>>'foreignKey' =>
>>>> 'reference_id'
>>>>)
>>>>)
>>>>)
>>>>);
>>>>}
>>>>
>>>>$model_data = $this->AreaInfo->$model_name->find('list');//
>>>> **
>>>> this is my question
>>>>print_r($model_data);
>>>>
>>>> the $model_data variable now is not empty, but i got something like
>>>> this :
>>>>
>>>> Array
>>>> (
>>>>[1] => 1
>>>>[2] => 2
>>>>[3] => 3
>>>>[4] => 4
>>>>[5] => 5
>>>>[6] => 6
>>>>[7] => 7
>>>>[8] => 8
>>>>[9] => 9
>>>>[10] => 10
>>>>[11] => 11
>>>>[12] => 12
>>>>[13] => 13
>>>>[14] => 14
>>>>[15] => 15
>>>>[16] => 16
>>>>[17] => 17
>>>>[18] => 18
>>>>[19] => 19
>>>>[20] => 20
>>>> )
>>>>
>>>> Fatal error: Cannot access empty property in {some_directories_path}
>>>> \app\controllers\areas_controller.php on line **
>>>>
>>>> is it possible to do such a thing like above? if yes or no please let
>>>> me know with your sugesstion :) ...
>>>>
>>>> >
>>>>
>>>
>>>
>>> >
>>>
>>
>>
>> >
>>
>
>
> >
>



  
--~--~-~--~~~---~--~~
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: Dynamic Model Call

2009-01-21 Thread Yusuf Widiyatmono
sorry it just a mark for the code line. 

Fatal error: Cannot access empty property in 
{some_directories_path}\app\controllers\areas_controller.php on line **

i mean that i got that message from this line

$model_data = $this->AreaInfo->$model_name->find('list');**






From: brian 
To: cake-php@googlegroups.com
Sent: Thursday, January 22, 2009 1:06:39 PM
Subject: Re: Dynamic Model Call


What is on line** (from the error msg)?

On Wed, Jan 21, 2009 at 10:37 PM, Yusuf Widiyatmono  wrote:
> the model is loaded...
> see the print_r result, the model can retrieve some data,
> but in the end the error still appear and make the further logic die
>
>
>
> 
> From: brian 
> To: cake-php@googlegroups.com
> Sent: Thursday, January 22, 2009 12:30:22 PM
> Subject: Re: Dynamic Model Call
>
>
> Are these models loaded?
>
> On Wed, Jan 21, 2009 at 6:10 PM, Yusuf Widiyatmono  wrote:
>> i did and it still shows me same errors...
>>
>>
>> 
>> From: brian 
>> To: cake-php@googlegroups.com
>> Sent: Thursday, January 22, 2009 2:49:31 AM
>> Subject: Re: Dynamic Model Call
>>
>>
>> Try $this->AreaInfo->{$model_name}->find(...)
>>
>> On Wed, Jan 21, 2009 at 12:33 AM, wmonou  wrote:
>>>
>>> Helo there i am trying to call model from a variable
>>>
>>> let say that i have a code is like this:
>>>
>>>// $model_name is a string
>>>// bind necessary model
>>>if(!empty($model_name)){
>>>$this->AreaInfo->bindModel(
>>>array(
>>>'belongsTo'=>array(
>>>$model_name => array(
>>>'className' =>
>>> $model_name,
>>>'foreignKey' =>
>>> 'reference_id'
>>>)
>>>)
>>>)
>>>);
>>>}
>>>
>>>$model_data = $this->AreaInfo->$model_name->find('list');// **
>>> this is my question
>>>print_r($model_data);
>>>
>>> the $model_data variable now is not empty, but i got something like
>>> this :
>>>
>>> Array
>>> (
>>>[1] => 1
>>>[2] => 2
>>>[3] => 3
>>>[4] => 4
>>>[5] => 5
>>>[6] => 6
>>>[7] => 7
>>>[8] => 8
>>>[9] => 9
>>>[10] => 10
>>>[11] => 11
>>>[12] => 12
>>>[13] => 13
>>>[14] => 14
>>>[15] => 15
>>>[16] => 16
>>>[17] => 17
>>>[18] => 18
>>>[19] => 19
>>>[20] => 20
>>> )
>>>
>>> Fatal error: Cannot access empty property in {some_directories_path}
>>> \app\controllers\areas_controller.php on line **
>>>
>>> is it possible to do such a thing like above? if yes or no please let
>>> me know with your sugesstion :) ...
>>>
>>> >
>>>
>>
>>
>> >
>>
>
>
> >
>



  
--~--~-~--~~~---~--~~
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: Dynamic Model Call

2009-01-21 Thread Yusuf Widiyatmono
the model is loaded...
see the print_r result, the model can retrieve some data, 
but in the end the error still appear and make the further logic die


 





From: brian 
To: cake-php@googlegroups.com
Sent: Thursday, January 22, 2009 12:30:22 PM
Subject: Re: Dynamic Model Call


Are these models loaded?

On Wed, Jan 21, 2009 at 6:10 PM, Yusuf Widiyatmono  wrote:
> i did and it still shows me same errors...
>
>
> 
> From: brian 
> To: cake-php@googlegroups.com
> Sent: Thursday, January 22, 2009 2:49:31 AM
> Subject: Re: Dynamic Model Call
>
>
> Try $this->AreaInfo->{$model_name}->find(...)
>
> On Wed, Jan 21, 2009 at 12:33 AM, wmonou  wrote:
>>
>> Helo there i am trying to call model from a variable
>>
>> let say that i have a code is like this:
>>
>>// $model_name is a string
>>// bind necessary model
>>if(!empty($model_name)){
>>$this->AreaInfo->bindModel(
>>array(
>>'belongsTo'=>array(
>>$model_name => array(
>>'className' => $model_name,
>>'foreignKey' =>
>> 'reference_id'
>>)
>>)
>>)
>>);
>>}
>>
>>$model_data = $this->AreaInfo->$model_name->find('list');// **
>> this is my question
>>print_r($model_data);
>>
>> the $model_data variable now is not empty, but i got something like
>> this :
>>
>> Array
>> (
>>[1] => 1
>>[2] => 2
>>[3] => 3
>>[4] => 4
>>[5] => 5
>>[6] => 6
>>[7] => 7
>>[8] => 8
>>[9] => 9
>>[10] => 10
>>[11] => 11
>>[12] => 12
>>[13] => 13
>>[14] => 14
>>[15] => 15
>>[16] => 16
>>[17] => 17
>>[18] => 18
>>[19] => 19
>>[20] => 20
>> )
>>
>> Fatal error: Cannot access empty property in {some_directories_path}
>> \app\controllers\areas_controller.php on line **
>>
>> is it possible to do such a thing like above? if yes or no please let
>> me know with your sugesstion :) ...
>>
>> >
>>
>
>
> >
>



  
--~--~-~--~~~---~--~~
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: getLastInsertId or something similar

2009-01-21 Thread Yusuf Widiyatmono
you can only get the value of getLastInsertId() method after saving something...

you have to do this before
$this->User->Event->save($this_data);
$last_event_id = $this->User->Event->getLastInsertId();

and this getLastInsertId() method is only working for save() method to insert 
new record to events table in database.
for using save() method to update a record, the getLastInsertId, will not give 
you anything too


---
is this the answer that you mean? sorry if i am mistaken what your question.



 Best Regards



Yusuf Widiyatmono

Software Engineer
Phone +62 (361) 755 025
Facsimile +62 (361) 755 024
Mobile +62 813 2126 4488
www.mitrais.com






From: mike 
To: CakePHP 
Sent: Thursday, January 22, 2009 9:13:48 AM
Subject: Re: getLastInsertId or something similar


does this mean I can't use getLastInsertId() if I inserted the event
in another controller? (this was one of my original questions)

In the events controller, I save the event, then redirect to the user
view.  In the user controller is where I'm trying to get the event_id
I just inserted.

On Jan 21, 4:49 pm, Webweave  wrote:
> It will only return a value after you do an insert (a save of the new
> Event).
>
> Post the action you are having trouble with, and perhaps we can spot
> the issue.
>
> On Jan 19, 3:41 pm, mike  wrote:
>
>
>
> > eeerrr, this is not working.
>
> > I have this in the User model:
> > var $hasMany = array ('Event');
>
> > this in the event model:
> > var $belongsTo = array (
> > 'User' => array(
> > 'className'=> 'User',
> > 'foreignKey'=> 'creator_id',
> > )
> > );
>
> > $this->User->Event->getLastInsertId() in the users controller returns
> > nothing!
>
> > what am I missing??
>
> > On Jan 19, 3:01 am, "Jon Bennett"  wrote:
>
> > > > where do I grab the lastInsertId()?  in the event_controller?  and
> > > >  then how do I pass it to the user view?
>
> > > provided you've correctly set up your model associations, which I think 
> > > are:
>
> > > User hasMany Event
> > > Event belongsTo User
>
> > > From your Users controller you can do:
>
> > > $event_id = $this->User->Event->getLastInsertId();
>
> > > hth
>
> > > jon
>
> > > --
>
> > > jon bennett
> > > w:http://www.jben.net/
> > > iChat (AIM): jbendotnet Skype: jon-bennett- Hide quoted text -
>
> - Show quoted text -


  
--~--~-~--~~~---~--~~
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: Dynamic Model Call

2009-01-21 Thread Yusuf Widiyatmono
i did and it still shows me same errors...

 





From: brian 
To: cake-php@googlegroups.com
Sent: Thursday, January 22, 2009 2:49:31 AM
Subject: Re: Dynamic Model Call


Try $this->AreaInfo->{$model_name}->find(...)

On Wed, Jan 21, 2009 at 12:33 AM, wmonou  wrote:
>
> Helo there i am trying to call model from a variable
>
> let say that i have a code is like this:
>
>// $model_name is a string
>// bind necessary model
>if(!empty($model_name)){
>$this->AreaInfo->bindModel(
>array(
>'belongsTo'=>array(
>$model_name => array(
>'className' => $model_name,
>'foreignKey' => 'reference_id'
>)
>)
>)
>);
>}
>
>$model_data = $this->AreaInfo->$model_name->find('list');// **
> this is my question
>print_r($model_data);
>
> the $model_data variable now is not empty, but i got something like
> this :
>
> Array
> (
>[1] => 1
>[2] => 2
>[3] => 3
>[4] => 4
>[5] => 5
>[6] => 6
>[7] => 7
>[8] => 8
>[9] => 9
>[10] => 10
>[11] => 11
>[12] => 12
>[13] => 13
>[14] => 14
>[15] => 15
>[16] => 16
>[17] => 17
>[18] => 18
>[19] => 19
>[20] => 20
> )
>
> Fatal error: Cannot access empty property in {some_directories_path}
> \app\controllers\areas_controller.php on line **
>
> is it possible to do such a thing like above? if yes or no please let
> me know with your sugesstion :) ...
>
> >
>



  
--~--~-~--~~~---~--~~
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: Protecting cake source?

2006-09-21 Thread yusuf

Are there any freeware tools to protect php source? I tried searching,
but didn't have much luck...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: Protecting cake source?

2006-09-21 Thread yusuf

> you might try searching the list, this was talked about just recently,
> try using terms like
> 'Zend Guard' or 'SourceGuardian'

Thanks, its here:
http://groups.google.com/group/cake-php/browse_thread/thread/a17fcf56c273b0/b6c655fa77420176?lnk=gst&q=Zend+Guard&rnum=3#b6c655fa77420176


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Protecting cake source?

2006-09-21 Thread yusuf

Hi,

If I were to create a whole application using cake framework, and I
want to distribute it to customers, is there a way I can protect the
source code of the files being distributed? Like compiling to object
code or something?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: exit() after redirect

2006-09-21 Thread yusuf


> Nope, calling exit() after a redirect doesn't break anything.  The only
> reason you wouldn't want to call it after a redirect is if you had some
> other functionality that needed to be executed in a controller
> callback, or if, for some reason, you really really wanted your view to
> render.

But if you redirected, why would you want your view to render? In fact,
how would it, because you are redirecting to another view...?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



exit() after redirect

2006-09-21 Thread yusuf

Hi,

On this page: http://manual.cakephp.org/appendix/simple_user_auth in
the example under "/app/controllers/users_controller.php (partial)"
there is no exit() after the redirect in the "login" function.

I have read on the web that you need to provide an exit() after the
redirect, or addtional code gets executed, so why is that missing?
Should there always be an exit() right after a redirect?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: How to with layout/templates?

2006-06-13 Thread yusuf

yes, i was trying to get at "theme"ing. thanks.



John Zimmerman [gmail] wrote:
> Chris Kausel created a class called Icing which I have not tried but I
> believe is trying to address some of the concerns that you have.
>
> You can view the code at
> http://cakeforge.org/snippet/detail.php?type=snippet&id=67
>
> Cake does not have built in support for the traditional "Theme" idea which I
> believe is what you are trying to accomplish, but if you keep your views
> restricted to the basics, styled only by CSS, and keep the actual look and
> feel in the stylesheets and your default layout, then when a design change
> needs to happen you only have 2-3 files to alter
> (app/views/layouts/default.thtml and the corresponding stylesheets).
>
> On 6/9/06, bigdog <[EMAIL PROTECTED]> wrote:
> >
> >
> > This might be a good start:  http://manual.cakephp.org/chapter/8 ;
> > [header][-->][footer]
> >
> > Each controller stores a template.  So that is where you would be
> > updating "$content_for_layout" for your templates
> >
> >
> > >
> >
>
> --=_Part_60531_6843881.1149961904314
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 1413
>
> Chris Kausel created a class called Icing which I have not tried but I 
> believe is trying to address some of the concerns that you have.You 
> can view the code at  href="http://cakeforge.org/snippet/detail.php?type=snippet&id=67";>
> http://cakeforge.org/snippet/detail.php?type=snippet&id=67Cake
>  does not have built in support for the traditional "Theme" idea 
> which I believe is what you are trying to accomplish, but if you keep your 
> views restricted to the basics, styled only by CSS, and keep the actual look 
> and feel in the stylesheets and your default layout, then when a design 
> change needs to happen you only have 2-3 files to alter 
> (app/views/layouts/default.thtml and the corresponding stylesheets).
> On 6/9/06,  class="gmail_sendername">bigdog  PROTECTED]">[EMAIL PROTECTED]> wrote: class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 
> 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> This might be a good start:   href="http://manual.cakephp.org/chapter/8";>http://manual.cakephp.org/chapter/8
>  ;[header][--> ?>][footer]Each controller stores a template.  So that 
> is where you would be
> updating "$content_for_layout" for your 
> templates
> 
> --=_Part_60531_6843881.1149961904314--


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



How to with layout/templates?

2006-06-09 Thread yusuf

The View part seems to have snippets of rendering code to render
particular data blobs (like a html table of values in a database). i
wanted to know, how this ties into the whole layout aspect.
Specifically, since the little view always has the same render code,
how is it truly able to change with the layout changes?

In other words, lets say I want "templating" where templates
continuously change based on page designs from the designers. I want to
be able to just copy in these templates and have them work with the
system. How would some one go about ensuring this level of flexibility
when starting out to design the system?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



popular framework?

2006-06-07 Thread yusuf

Is cake php the most popular framework for php? Are there others that
are widely used out there?

Also, how does cake scale up, in terms of users and resource over head?

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---