how to call one function of one contoller into another controller

2012-07-17 Thread sneha kulkarni
how i can call one function of one controller into another controller.plz help -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To

Re: how to call one function of one contoller into another controller

2012-07-17 Thread Dr. Tarique Sani
While you can do what Chetan says - you should not be required to that... Consider creating a component if several of your component share the same code OR slight less worse than above create a method in app controller HTH Tarique On Tue, Jul 17, 2012 at 12:16 PM, Chetan Patel

Re: how to call one function of one contoller into another controller

2012-07-17 Thread euromark
exactly in short: you don't most cases you got your coding wrong. try to put your code into the model, a component, a lib or some other more generic class where you can access and call it from all controller methods you need it. but including other controllers will only result in a mess in the

Re: NEED HELP

2012-07-17 Thread Lboogie
Thank you all very much...I spoke with Larry form Cake DC who helped me get it running. He did explain to me that i needed to provide more info concerning the problem. Thanks again to you all. On Monday, July 16, 2012 9:40:06 AM UTC-4, Lboogie wrote: Hello, i am trying to install a project

Re: Fast alternative to contains?

2012-07-17 Thread ProLoser
Actually you may want to hit up my fork https://github.com/ProLoser/linkable it has a very critical fix that's been missing for a while. /end blatant namedropping On Monday, July 16, 2012 4:11:31 PM UTC-7, gremlin wrote: Try this - https://github.com/sams/linkable It is a newer version

Re: Passing an email address as param with a plus(+) sign

2012-07-17 Thread Matt Brooks
So I know this post happened nearly 3 years ago, but this really stumped me for a good while. The final solution I came up with was to triple encode the email address before passing it to the URL like so: $enc_email = urlencode(urlencode(urlencode('foo+...@example.com'))); This in turn would

Re: Trouble using Joins

2012-07-17 Thread Bharat Maheshwari
can you please post your database structure that can easily find out what you actually want On Sunday, July 15, 2012 7:30:05 AM UTC+5:30, Michael wrote: I am trying to get my mind around using joins in my finds to gain the ability to use associated models in my conditions. I run into a

Re: Edit User on second submit

2012-07-17 Thread Bharat Maheshwari
you have to post a id set from the action in your controller :- $this-set('id',$id); in your view $this-Form-hidden('id',array('value'=$id)); On Saturday, July 14, 2012 12:21:11 PM UTC+5:30, chuminh wrote: I am having the same problem with edit. I got exactly the same code as above.

Re: Edit User on second submit

2012-07-17 Thread Banana Man
So when you go to the first edit screen the id is being passed in the URL from the link: ?php echo $this-Html-link(__('Edit'), array('action' = 'edit', $user['User']['id'])); ? : but no id is specified when you click the submit link on the edit page. If i then add a hidden field to the edit

Re: how to call one function of one contoller into another controller

2012-07-17 Thread Bharat Maheshwari
Not a big issue you can simply use requestaction just like in a cpt file Suppose you have a function in *user controller* named : - * getUserDetail($user_id)* and now you want to use this function in post controller then simply write

Re: Edit User on second submit

2012-07-17 Thread Bharat Maheshwari
You can also try this code in your edit.cpt file *?php echo $this-Form-create('User', array('action' = 'edit/'.$id));?* where $id is set from the edit() function in controller On Tuesday, July 17, 2012 3:12:25 PM UTC+5:30, Banana Man wrote: So when you go to the first edit screen the id is

Re: how to call one function of one contoller into another controller

2012-07-17 Thread AD7six
On Tuesday, 17 July 2012 12:59:59 UTC+2, Bharat Maheshwari wrote: Not a big issue you can simply use requestaction just like in a cpt file Suppose you have a function in *user controller* named : - * getUserDetail($user_id)* and now you want to use this function in post controller then

Re: Edit User on second submit

2012-07-17 Thread AD7six
On Wednesday, 11 July 2012 15:20:21 UTC+2, Banana Man wrote: Hi, I am trying to setup an Edit User authentication action. I have authentication working fine for adding a user but when i try to edit a user i am running into a problem. If i try to edit a user when all information

Re: how to call one function of one contoller into another controller

2012-07-17 Thread Bharat Maheshwari
I just know how to solve problem easily doesn't matter how If you really worried about the logic then put a great code here and i assure i will also use your code So please guide me also. On Tuesday, July 17, 2012 4:54:54 PM UTC+5:30, AD7six wrote: On Tuesday, 17 July 2012 12:59:59 UTC+2,

Re: Edit User on second submit

2012-07-17 Thread Banana Man
Hi AD7six Ok, that seems to have it working. Thanks for all the replies to get this resolved! Ronan On Tuesday, July 17, 2012 1:27:15 PM UTC+2, AD7six wrote: On Wednesday, 11 July 2012 15:20:21 UTC+2, Banana Man wrote: Hi, I am trying to setup an Edit User authentication action. I

Re: how to call one function of one contoller into another controller

2012-07-17 Thread AD7six
On Tuesday, 17 July 2012 13:36:24 UTC+2, Bharat Maheshwari wrote: I just know how to solve problem easily doesn't matter how If you really worried about the logic then put a great code here and i assure i will also use your code So please guide me also. now-3 people have already done

Re: Form file upload problem

2012-07-17 Thread Bharat Maheshwari
*Did you use the enctype for post media data?* On Thursday, July 12, 2012 1:00:24 PM UTC+5:30, technobulka wrote: create input file: $this-Form-file('color.'.$prod_color['id'].'.images.'.$i) in html i see: data[color][1][images][0] ... data[color][1][images][9] but

Re: Cache::delete not working.

2012-07-17 Thread ianemv
More than a year, have you solved or find out a solution to this issue? On Monday, 23 May 2011 12:44:44 UTC+8, Krissy Masters wrote: Not sure why it won’t delete. I even handcoded it and put the code in the controller view function to test out that there was a cache key, so I know its

Getting Started

2012-07-17 Thread Banana Man
Hi, I have finished the User Authentication tutorial and have it up and running now. I found the tutorial useful but also think it lacks detailed enough descriptions about what is being done at each stage of the code. I am now trying to add the functionality that when a new user account is

Link checker suddenly reports nearly all links as http://www.domain.com/index.php/en/level1/level2...

2012-07-17 Thread DigitalDude
Hey, I'm wondering why this happens, but within the last days the linkchecker reports nearly all links within my app with *index.php* within my urls! When I check the source of the website, there are no links with the index.php within. I cannot find out why these links are built. The only

Re: Getting Started

2012-07-17 Thread lowpass
$this-User-create() initialises an object instance. It is required when creating several instances while in a loop. $this-request-data represents the data that has been POSTed as part of the server request. $this-request-data['User']['hashtoken'] = $hashToken; $this-User-set($this-request-data);

Two tables with multiple relationships

2012-07-17 Thread Andrew Johnston
Hello Again Everyone- I'm having a bit of trouble establishing my databases. To sum up my application, it allows users to make modules which then can be viewed by other users of the creator's choice. So I have: User hasMany Module -- This is where I place the user id number of the creator

Charts - Anyone knows a good valid one?

2012-07-17 Thread Marcelo Santana
Hello, all, i'm needing display some charts i tried: http://bakery.cakephp.org/articles/ixu38/2010/04/30/googlechart-api-helper show the charts but i can't configure the way i want, the line chart is terrible (or someone who use it successfully can show how... )

Re: Link checker suddenly reports nearly all links as http://www.domain.com/index.php/en/level1/level2...

2012-07-17 Thread DiabloGeto
I assume that you are talking about your cakephp app or ststic pages as it sis not obvious from your mail at all. it depends where you have put ur htaccess. I expect u have placed the rule in webroot of your cakeapp, n not in webroot of ur webhosting. surely this rule is overriding some link

Re: Fast alternative to contains?

2012-07-17 Thread Christian
Also a good one to know for future, but only works for 'hasOne' or 'belongsTo'. Doesn't throw an error for 'hasMany' or 'HABTM', but will not fetch all related data sets (or did I just use it wrong?). $this-Productgroup-find('first', array('link' = array('Category', 'Product' =

Re: Link checker suddenly reports nearly all links as http://www.domain.com/index.php/en/level1/level2...

2012-07-17 Thread DiabloGeto
you can use these rules set in all the other htaccess outside ur webroot of cake. RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L] RewriteRule^$/webroot/[L] RewriteRule(.*) /webroot/$1[L] and remove ur https redirect from

Re: Two tables with multiple relationships

2012-07-17 Thread DiabloGeto
you can very well implement HABTM for users--modules relationship simplly including the owner as a user. Further in the controller or view,give condition for only owner to be able to edit. Or u can give a column as user_id in the module table, to track the owner of the modules, but if u go for

Re: Fast alternative to contains?

2012-07-17 Thread euromark
@ProLoser your current version doesnt work for me anymore. seems like `$options['fields'] = str_replace($options['class'], $alias, $options['fields']);` is killing it: Column not found: 1054 Unknown column 'MainMainTag.name' in 'field list' removing this line and the tests run again. are there

Re: Looking for a CakePHP Developer ASAP

2012-07-17 Thread DiabloGeto
@Dr. Tarique Well, for jobs these are the words which can make people antsy enough to not see the details and put themselves out on a limb. BTW u stole my words in ur first reply. ;) === -- Our newest site for the community: CakePHP Video

Re: Charts - Anyone knows a good valid one?

2012-07-17 Thread Dr. Tarique Sani
Currently I am enjoying http://www.highcharts.com/ though it is not free for Commercial use Tarique On Wed, Jul 18, 2012 at 2:30 AM, Marcelo Santana marcelo...@gmail.com wrote: Hello, all, i'm needing display some charts i tried:

Re: Fast alternative to contains?

2012-07-17 Thread gremlin
I believe the docs have this working alongside contains already - if you convert your habtm to hasMany through associations and use contains for the hasMany to generate the in( id, id2 ,id3 ) conditions then you should have it down to a single query or at most a small handful. Thanks for

Re: Charts - Anyone knows a good valid one?

2012-07-17 Thread Борислав Събев
I can reccomend these three: http://www.amcharts.com - JS/HTML5 - licensed for commercial use http://www.pchart.net/ - PHP - licensed for commercial use http://jpgraph.net/- PHP - licensed for commercial use On Wednesday, 18 July 2012 00:00:10 UTC+3, Marcelo Santana wrote:

Re: Charts - Anyone knows a good valid one?

2012-07-17 Thread Jeremy Burns | Class Outfit
Google charts are terrific. Jeremy Burns Class Outfit http://www.classoutfit.com On 18 Jul 2012, at 05:47:10, Борислав Събев wrote: I can reccomend these three: http://www.amcharts.com - JS/HTML5 - licensed for commercial use http://www.pchart.net/ - PHP - licensed for commercial use

Re: how to call one function of one contoller into another controller

2012-07-17 Thread Борислав Събев
requestActoin() is meant to be used in views but as said it will initialize a whole request which is not as slow as CakePHP 1.3 but nevertheless shared controller logic should be packaged in some way. :) This could be done with a Component or in AppController. For example if you have a function