search function results

2011-03-09 Thread chris...@yahoo.com
Hi ALL, can someone help me with "search" function... When I have 2 or more words in search field I'm getting en error on URL bar with %20 where I'm missing str_replace(' ', '+', and don't know where to put here is what I have in my controller ... function search() { $this->pagina

Re: Mobile Phone Layout - Using the RequestHandler in the CakeErrorController / AppError

2011-03-09 Thread thatsgreat2345
What I would do is in your app_controller.php (if you don't have on make it) you can create a function probably in beforeFilter to check if it is mobile. Then you can set a variable like $this->isMobile and see if it's true or not wherever yo need it. Just something I thought about, maybe wait for

Re: Take id from autocomplete's data

2011-03-09 Thread thom
On Wed, Mar 9, 2011 at 1:01 PM, thom wrote: > Hello, > > I am learning CakePHP and now using Cake 1.3. I have a worked auto > complete. I follow the instruction in the manual. The problem is, I'd > like to take id from auto complete's data. What should I do, since > what i need is the id from the

Re: Problems in saving form data to database

2011-03-09 Thread Jeremy Burns | Class Outfit
This line looks wrong: if ($this->Post->save($this->data['Post']['user_id']) == true) { Try: if ($this->Post->save($this->data['Post']) == true) { Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 10 Mar 2011, at 06:15, goluhaque wrote: > My controller-> >

Problems in saving form data to database

2011-03-09 Thread goluhaque
My controller-> function add() { if (!empty($this->data)) { $this->Post->create(); $this->data['Post']['user_id'] = $this->Auth->user('id'); if ($this->Post->save($this->data['Post']['user_id']) == true) { $this->Session->setFlash(__('The post user id has been saved', true)); }

Re: cakephp shared hosting question

2011-03-09 Thread Tan Cheng
Thanks for your help. I have a question, when you say "put your webroot in your public_html ", do you mean put the "webroot" folder in public_html, or you mean put the files in the webroot in the "public_html"? Thanks!! -David On Mar 9, 9:42 pm, thatsgreat2345 wrote: > I guess I should have us

Mobile Phone Layout - Using the RequestHandler in the CakeErrorController / AppError

2011-03-09 Thread DigitalDude
Hey, I'm running into a really mean problem and I have no clue how to solve this. In my app I let the RequestHandler check if the Request comes from a mobile phone. This works fine for all controllers and actions, except the error pages! After looking through the core code of cake and some readi

Re: cakephp shared hosting question

2011-03-09 Thread thatsgreat2345
I guess I should have used your example folder where I said folder_you_want_to_access_your_site_through, name that exceltv and you can call your app folder whatever you want This way, if you want to run multiple cake sites on your shared host you will have all the apps inside your cake folder The

Re: cakephp shared hosting question

2011-03-09 Thread thatsgreat2345
You need to put your webroot in your public_html and then change your index.php file in webroot to point to your cake root and your app path This is how I have it setup. /cake /appnamehere /controllers /models /other stuff /cake

cakephp shared hosting question

2011-03-09 Thread Tan Cheng
Hi everyone, My boss wants the project I'm working with cakephp to be seen on a host as soon as possible. I signed up with Cirtex hosting, but when I upload, it doesn't work directly, I am contacting them to change the mod_rewrite and some other settings, but I don't want to sit here and waiting

Re: Database and Model Design Question

2011-03-09 Thread grady
In my setup the preview_id field is in the artifact table, which means that it belongsTo Preview as I understand it. Then, my Preview hasMany Artifact relationship also allows me to use the same picture for multiple artifacts if I wanted to. (Whether or not I really want that is debatable I s

Re: Database and Model Design Question

2011-03-09 Thread cricket
On Wed, Mar 9, 2011 at 9:53 AM, grady wrote: > Ah, apologies for my lack of research... > The key point that I was missing (and I had read over the "Multiple > relations to the same model" section) was that in order to have multiple > relations you must use a different alias.  I had both relations

Re: Database and Model Design Question

2011-03-09 Thread cricket
On Tue, Mar 8, 2011 at 3:27 PM, grady wrote: > I posted a question similar to the following on the unofficial CakePHP > forums over a week ago and haven't received any sort of response, and > then I noticed the google group so here is my second attempt... > > I'm working on a site mainly to get my

Re: constructClasses() ????

2011-03-09 Thread Jeremy Burns | Class Outfit
Look up requestAction. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 9 Mar 2011, at 17:01, Carachi wrote: > Thank you Tilen > I don't want load an other controller in the construct of this class. > I want pass some variable to an other controller via contru

Re: constructClasses() ????

2011-03-09 Thread Carachi
Thank you Tilen I don't want load an other controller in the construct of this class. I want pass some variable to an other controller via contruct: For example: class SomeController extends AppController { function __construct($variable) { parent::__construct(); ...

Re: SaveAll 100000 data form Sql server to Mysql

2011-03-09 Thread Stephen
Your query is too large, you have a limit of 128mb and the query is probably handling much more data than that. Try to find a more efficient way of doing this rather than all at once? On 9 March 2011 16:15, cakephp_rocks wrote: > i use 2 dbConfigs one conncects to mysql the other connects to SQ

SaveAll 100000 data form Sql server to Mysql

2011-03-09 Thread cakephp_rocks
i use 2 dbConfigs one conncects to mysql the other connects to SQL Server so Detail is Sql Server and DataDetail is Mysql this is my code so far any idea how i can do this i get this error is it possiable to do a beforeSave{} to see if the data exists import new ones Allowed memory size of

Re: Make webroot index the home page

2011-03-09 Thread lauraw
> > If you want them both on the same hostname, then you have to decide how the > URLs will mingle. Your DocumentRoot will point to one of the two systems, and > you'll set up Alias or maybe Rewrite rules for the URLs of the other system. > I know CakePHP comes with Rewrite rules that you're s

Re: constructClasses() ????

2011-03-09 Thread Tilen Majerle
yes you can use model's methods in controller, but not controller's methods in model...if you want to use same logic in a lot of models, then use behaviors...:) :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/3/9 Jeremy Burns | Class Outfit > Really? Maybe I am showing my ignorance her

Re: constructClasses() ????

2011-03-09 Thread Jeremy Burns | Class Outfit
Yup - I know that, but the reply seemed to suggest you could get to a controller function from within a model, which I didn't think was possible. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 9 Mar 2011, at 15:34, Tilen Majerle wrote: > yes you can use mod

Re: table row pay_unique_ident get identified as PayUniqueent?

2011-03-09 Thread Tilen Majerle
because of _id, if you connect 2 models, then they are connected with modelalias_id in other controller so like that POST model (hasMany Comment) posts table: id, title, created, modified, ...other rows in table COMMENT model (belongsTo Post) comments table: id, post*_id *//connected with post

Re: constructClasses() ????

2011-03-09 Thread Jeremy Burns | Class Outfit
Really? Maybe I am showing my ignorance here, but can you access a model's controller functions from within the model? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 9 Mar 2011, at 14:55, Krissy Masters wrote: > If the controller is related thru Model relat

RE: constructClasses() ????

2011-03-09 Thread Krissy Masters
If the controller is related thru Model relations then you can chain them like $this->User->Gallery->Image You can access any user / gallery / image controllers action thru the chain Or if not related use Telen's loadModel. K From: cake-php@googlegroups.com [mailto:cake-php@googleg

table row pay_unique_ident get identified as PayUniqueent?

2011-03-09 Thread heohni
Hi, I have a row in my table called pay_unique_ident. When I bake the model, cake builds a var $belongsTo = array( 'PayUniqueent' => array( 'className' => 'PayUniqueent', 'foreignKey' => 'pay_unique_ident', 'c

Re: Database and Model Design Question

2011-03-09 Thread grady
Ah, apologies for my lack of research... The key point that I was missing (and I had read over the "Multiple relations to the same model" section) was that in order to have multiple relations you *must* use a different al

Re: constructClasses() ????

2011-03-09 Thread Tilen Majerle
but, i really don't know why u use other controller in some controller... ...if you want same logic in both controllers, then use components (in controller) / helpers (in views), if you need to connect with other database table, then use $this->loadModel('ModelName'); in controller to load some mod

Re: constructClasses() ????

2011-03-09 Thread Tilen Majerle
it's not __constructor() but __construct() beforeFilter() callback is called AFTER __construct, but try this (in AppController, or anyone else you want), maybe works if i understand u good, so: class SomeController extends AppController //or extends Controller if you work in AppController { fu

Re: constructClasses() ????

2011-03-09 Thread Carachi
Thank you Tilen I want to set some global variable because I use this a lot of time in the controller. So when controller is builds I prefer set this value and use it. In php I use __constructor() but in cake? Is right use beforeFilter() like constructor? When I want use a controller from an other

Re: constructClasses() ????

2011-03-09 Thread Tilen Majerle
why you want to do that, i'm sure you can do this in other way...:) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/3/9 Carachi > If I want set some parameter in the construct class, how can I do?? > > On Mar 9, 2:12 pm, Jeremy Burns | Class Outfit > wrote: > > Try putting it in beforeF

Re: constructClasses() ????

2011-03-09 Thread Carachi
If I want set some parameter in the construct class, how can I do?? On Mar 9, 2:12 pm, Jeremy Burns | Class Outfit wrote: > Try putting it in beforeFilter() instead (and don't forget to include > parent::beforeFilter() too). > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://

Re: Problem displaying session flash messages

2011-03-09 Thread Daniel
That fixed it. Thanks for your help! Daniel On Mar 9, 12:42 pm, Jeremy Burns | Class Outfit wrote: > That's slightly old syntax. Try echo $this->Session->flash(); > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 8 Mar 2011, at 23:25, Daniel wrote:

Re: constructClasses() ????

2011-03-09 Thread Carachi
Works!!! Thank you very very much !! On Mar 9, 2:12 pm, Jeremy Burns | Class Outfit wrote: > Try putting it in beforeFilter() instead (and don't forget to include > parent::beforeFilter() too). > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 9 Mar

Re: constructClasses() ????

2011-03-09 Thread Jeremy Burns | Class Outfit
Try putting it in beforeFilter() instead (and don't forget to include parent::beforeFilter() too). Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 9 Mar 2011, at 13:02, Carachi wrote: > Hi, > I have this problem. > I want use a construct for a my controller

constructClasses() ????

2011-03-09 Thread Carachi
Hi, I have this problem. I want use a construct for a my controller so I insert in this controller this function: var $user; public function constructClasses(){ $this->user = 'test'; } but it return this error: Fatal error: Call to undefined method stdClass::allow() in /home/www/ app/controller

Re: Problem displaying session flash messages

2011-03-09 Thread Jeremy Burns | Class Outfit
That's slightly old syntax. Try echo $this->Session->flash(); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 8 Mar 2011, at 23:25, Daniel wrote: > Hi everyone. I've been working through the book "Beginning CakePHP" > and have hit a stumbling block at Chapter

Take id from autocomplete's data

2011-03-09 Thread thom
Hello, I am learning CakePHP and now using Cake 1.3. I have a worked auto complete. I follow the instruction in the manual. The problem is, I'd like to take id from auto complete's data. What should I do, since what i need is the id from the autocomplete's data (I need to insert it to database)?

How to validate multiple fields with the same name?

2011-03-09 Thread Eddy
Hello people. I been trying to validate a form with several product names but haven't been succesful. The last two days were spent searching for a way to do this but with no results either. The thing is I have a view with a form with a single field: product_name and the necesary code in the control

Problem displaying session flash messages

2011-03-09 Thread Daniel
Hi everyone. I've been working through the book "Beginning CakePHP" and have hit a stumbling block at Chapter 6. I can't get my flash message to appear when there's an error! My baked Posts Controller has the function: function view($id = null) { if (!$id) {

Re: Thinking about using Cake PHP to develop some sites

2011-03-09 Thread traedamatic
Hey, i also want to start a project with cakephp. I use cakephp for some time but only in smaller projects. The next project is alot bigger and serious, so I want to write test for my code. When I now start writing test for 1.3.7 i have to use simpletest which will be no more suppoert in the 2.0 b

Re: Need help with paginate conditions

2011-03-09 Thread netusco
Hi, I see something... I use $this->paginate = $options; then this: $options['fields'] = array('Member.id'); looks fine to me this: $options['or'] = ... looks out of it's array conditions I would use $options['conditions']['or'] = ... maybe like this the fields would be recognized... then $reg