Problem when I access a table, can't change it name and it wasn't named on plural form

2009-08-26 Thread JuanWalker
I'm tryinig to access a modem that I can't change the name through another model ( belongsto association) the problem is that this table was not created using plurar form so I have problems when I try to access it. UseTable it's not working on this, please helpme. Here's the code : class

Re: Problem when I access a table, can't change it name and it wasn't named on plural form

2009-08-26 Thread womble
In the Model you can specify the name of the table that it should use: var $useTable = 'tablename'; On Aug 26, 2:54 pm, JuanWalker juanwal...@gmail.com wrote: I'm tryinig to access a modem that I can't change the name through another model ( belongsto association) the problem is that

Re: Why do users keep redirecting to the home page on login?

2009-08-26 Thread John Andersen
Do you have a beforeFilter in your users controller, and if yes, does it invoke the parent beforeFilter? Enjoy, John On Aug 26, 8:59 am, DavidH djhollingwo...@gmail.com wrote: Just changed the subject back from solved to not solved. I found that unless I have autoRedirect = false in both

MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
Hi I'm trying to understand if and in which way could be possible to achieve such a result. Maybe I've explained the wrong way: I need to format some common fields like boolean value and achieve this adding an afterFind(results) callback in the app_model.php. I'd like to know if this is the best

Re: class Overloadable2

2009-08-26 Thread Biaggi
Ok, as far as I see Overloadable2 is used basically when you need auto- magically generated getters and setters. So is just a bad decision in the class name :) Thank you Mark On Aug 25, 8:10 pm, mark_story mark.st...@gmail.com wrote: I don't think its deprecated. The JsHelper in 1.2 uses it

Re: MVC-way to obtain common data formatting

2009-08-26 Thread Jon Bennett
Hi Nicola. I'm trying to understand if and in which way could be possible to achieve such a result. Maybe I've explained the wrong way: I need to format some common fields like boolean value and achieve this adding an afterFind(results) callback in the app_model.php. I'd like to know if

ACL bug when Auth::authorize = 'actions'? 1.2.4.8284

2009-08-26 Thread housebolt
Hi All, Currently using version 1.2.4.8284 I spent a good half-day trying to get the Auth and Acl components to play nicely with the Auth::authorize var equal to 'actions' and a single root ACO node of 'controllers', accessible by the ARO that is connected to a Group model, which has many users

Re: encoding problems: utf-8

2009-08-26 Thread danfreak
Cheers guys, well my problem is mainly related to the DB entries. I'm deploying my application to the production server with capistrano, pulling the application from a github (git) repository. I have teh following DB config:

Re: encoding problems: utf-8

2009-08-26 Thread danfreak
From phpinfo() I have Apache: HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7 on both servers. Dev server: PHP Version 5.2.6 MySQL 5.0.67

Re: Apply YUI(yahoo) editor in cakephp1.2

2009-08-26 Thread liyakat Ali
I am Searching on web but not find proper solution if you have vendor class or helper. Please guide for the same in littel beat detail. On Wed, Aug 26, 2009 at 9:37 AM, Marcelo Andrade mfandr...@gmail.comwrote: On Wed, Aug 26, 2009 at 8:51 AM, liyakat Ali ali786...@gmail.com wrote: hi

Re: Defining custom constants in models

2009-08-26 Thread pph7
Thx! I didnt know about that yet! On Aug 26, 6:31 am, Dr. Loboto drlob...@gmail.com wrote: If you're using PHP5 you can try class constants for this:http://ru2.php.net/manual/en/language.oop5.constants.php Because defines are _global_ as euromark mentioned. On Aug 25, 5:53 pm, pph7

Friendly image/files URL routing

2009-08-26 Thread MrMeikel
Hi, I am uploading files(images, mp3s etc) to my webroot /files/ folder. The files are named their id number.their extension. Without any custom routing I can access these files by /files/343.png. I would like to access this file by using the URL /files/343- sometitle.png as well. At the moment

how to implement comentaries?

2009-08-26 Thread Persivo Cunha
Hi, people i wanna show commentaries in my site and i would like be possible answers them. What i want is to show something like youtube author answer commentaries So, after click on answer, one textarea should appear after comentaries. How can i start?

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
Hi Jon thanks for your kind reply but that's just what I'd avoid: I'm trying to accomplish an automatic way to achieve that result, I know it's not right to use a model function and I asked for an MVC and non- validation-breaking way.. On 26 Ago, 11:23, Jon Bennett jmbenn...@gmail.com wrote:

Re: Friendly image/files URL routing

2009-08-26 Thread Jon Bennett
Hi, I am uploading files(images, mp3s etc) to my webroot /files/ folder. The files are named their id number.their extension. Without any custom routing I can access these files by /files/343.png. I would like to access this file by using the URL /files/343- sometitle.png as well. At the

Re: MVC-way to obtain common data formatting

2009-08-26 Thread Jon Bennett
Hi Nicola, thanks for your kind reply but that's just what I'd avoid: I'm trying to accomplish an automatic way to achieve that result, I know it's not right to use a model function and I asked for an MVC and non- validation-breaking way.. Another way would be to create a helper. How about

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
@ Bert: yes that's the problem, I'm looking for a way to accomplish in an automatic way and not only for boolean fields (which aren't difficult to implement with an ad-hoc behavior) On 26 Ago, 15:46, Bert Van den Brande cyr...@gmail.com wrote: I don't really understand the problem you present.

Re: Apply YUI(yahoo) editor in cakephp1.2

2009-08-26 Thread amrish.prajapati
I am searching for vendor file that can be used for yui editor. But I am not getting.. Do you have any idea for same On Aug 26, 9:07 am, Marcelo Andrade mfandr...@gmail.com wrote: On Wed, Aug 26, 2009 at 8:51 AM, liyakat Ali ali786...@gmail.com wrote: hi I need to Apply YUI(yahoo)

Site's home page

2009-08-26 Thread Matias_castro
I have already studied (implemented) the blog and acl tutorials getting quite familiar with the basic elements of the framework. I've also learnt how to use a bit of bake. My question came when I wanted to start my own web page. I have my data model, logic, structure (all of them in design), and

missing_tabel

2009-08-26 Thread Hidensoft
when i create controller , cakephp show missing_tabel error any controller must be have tabel ? i want create controller without tabel, can i do this ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group.

Re: MVC-way to obtain common data formatting

2009-08-26 Thread Bert Van den Brande
I don't really understand the problem you present. Either you display a model field as a read-only piece of information in the view, and then there is no problem with data being updated. Or you display model data in a form that can be edited, and in case of for example the boolean you provide a

Re: Site's home page

2009-08-26 Thread Bidibule
Hi Matias, You don't need a database for your model You can use the $useTable = false; to disable the use of database in your model/controller You can make a 'Page' controller and a 'home' action/view to display your home page Then you can use Routes to set your index page is pages/home I

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
That's a good starting point but there's need to change every interested line in the views, while I'd like to obtain an automatic and centralized solution i.e. if I write a new page there should be no need to remember that work-around On 26 Ago, 15:42, Jon Bennett jmbenn...@gmail.com wrote: Hi

Re: Why do users keep redirecting to the home page on login?

2009-08-26 Thread DavidH
I do indeed John. This is my current UsersController beforeFilter: function beforeFilter() { // // Inherit beforeFilter from appController // parent::beforeFilter(); $this-Auth-autoRedirect = false; } On Aug 26, 7:53 am, John Andersen

Cakephp way to add related items

2009-08-26 Thread #2Will
Hi all. I have a situation, that must be very common, and i'm wondering what the Cakephp approved way to do it is. I don't really want to just make up a way, because i might lose some of the goodness of following the conventions etc. I have a page with an article on it, and want a form to add

Overwrite html link method

2009-08-26 Thread Aurimas Lickus
Hello, What i am doing wrong with link overwrite, as it is not working. in AppHelper function __construct() { parent::__construct(); } function link($title, $url = NULL,$htmlAttributes = array(), $confirmMessage = false,$escapeTitle = true){ $title .= test; return

design patterns and ways CakePHP makes a developers life easy.

2009-08-26 Thread tass.skoud...@gmail.com
Hi all, I'm a big CakePHP supporter and introduced it to a few enterprises as both a framework and development methodology. Recently I started using Tumblr and thought it might be possible to use it for some good, providing knowledge about development practices in small bite size chunks then

Hi, my server admin in not loving changes.

2009-08-26 Thread Cosmin Paul
Hi, I am a programmer from a 7 gays team, and I have recently finisher my module. When I uploaded my work to stage one server, I have a bug in sql query generated by cake: It appends the model name to an alias code MortgageDetail`.(`interest_only_rate + 0 `) as interest_only_rate, /code. This is

added a new table field but cant seem to be able to read/save/update that particular field

2009-08-26 Thread danielle raymond
I am developing my first cake app. everything is going fine until I altered my table to include a new field, everything still saves but it just wont save into my newly created field? Is there any procedure when it comes to altering tables? --~--~-~--~~~---~--~~

Saving / Updating Associated Data

2009-08-26 Thread bg
dear cakephp users, i am in the process of extending a simple cakephp app which now requires me to use multiple tables and data associations. now i'm stuck at a problem and i looking for help! basically i have one form from which i want to save/update to several models. when the user adds or

Re: missing_tabel

2009-08-26 Thread amol jadhav
Hey, You can do this using controller attribute $uses. Follow that link: http://book.cakephp.org/view/51/Controller-Attributes -- Amol a...@weboniselab.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP

Bug: apc_cache expiry

2009-08-26 Thread Vlad
There is a bug when apc_cache is used. This leads to cached entries which will never expire. Current code apc.php function write($key, $value, $duration) { $expires = time() + $duration; apc_store($key.'_expires', $expires, $duration); // here is a bug.

Re: how to implement comentaries?

2009-08-26 Thread Cosmin Paul
Make your db schema, and use cake command line tool for a first draft and admin part, and after that make the front end. On Wed, Aug 26, 2009 at 3:21 PM, Persivo Cunharicky...@gmail.com wrote: Hi, people i wanna show commentaries in my site and i would like be possible answers them. What i

Re: Site's home page

2009-08-26 Thread Matias_castro
Yes, I believe that should work. I have one more dought; shouldn't I use the APP/views/pages/home.ctp to build up my home page? instead of treating the home like any other view? and if this is so, how do I controle THAT home? I mean, if I want it to display contents of a database/table

Re: encoding problems: utf-8

2009-08-26 Thread brian
How are you moving the data between servers? And are you using MySQL? It can be a real PITA when it comes to UTF-8. I've noticed, for example, that PHPMyAdmin fails to include a line, 'SET NAMES utf-8' in the dumps it produces, which can mean that MySQL will b0rk the text when it's read in. On

get profile id when user logs in

2009-08-26 Thread Paulos23
Hello people, I am facing a small problem here.To get you to the point i have 2 models User,Profile and their controllers as well.I have set up the relations and then i created an element which appears when user logs in.In the element i have put options in order to view,edit User details and

Re: Site's home page

2009-08-26 Thread brian
Copy the file cake/libs/controllers/pages_controller.php to your controllers folder. Edit you config/routes.php file to have: Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Next, create a view file at views/pages/home.ctp with your home page. On Wed, Aug 26,

Re: MVC-way to obtain common data formatting

2009-08-26 Thread Jon Bennett
Hi ark0n3, That's a good starting point but there's need to change every interested line in the views, while I'd like to obtain an automatic and centralized solution i.e. if I write a new page there should be no need to remember that work-around I don't see a way around that really. You

Re: added a new table field but cant seem to be able to read/save/update that particular field

2009-08-26 Thread brian
Delete everything in tmp/cache/models folder. Also, set debug to 2. This will force Cake to fetch the table schema using DESCRIBE TABLE. On Wed, Aug 26, 2009 at 6:15 AM, danielle raymondmcflose...@hotmail.com wrote: I am developing my first cake app. everything is going fine until I altered

Re: Site's home page

2009-08-26 Thread Matias_castro
OK, but, where do I put the logic of that home.ctp? for instance if I want to display data from another model (ie. news)? On 26 ago, 11:54, brian bally.z...@gmail.com wrote: Copy the file cake/libs/controllers/pages_controller.php to your controllers folder. Edit you config/routes.php file to

Re: Cakephp way to add related items

2009-08-26 Thread brian
In CommentsController::add() do something like this: if ($this-Comment-validates()) { if ($this-Comment-save($this-data)) { ... } else { ... } } else { $this-Session-setFlash('...'); $this-redirect(

Re: MVC-way to obtain common data formatting

2009-08-26 Thread Jon Bennett
That's a good starting point but there's need to change every interested line in the views, while I'd like to obtain an automatic and centralized solution i.e. if I write a new page there should be no need to remember that work-around I think you'll find it easier to tackle this issue once

Re: Saving / Updating Associated Data

2009-08-26 Thread brian
How do you specify a Dealer or Location in the form? Normally, Cake would expect $data to be, eg: $data['Artwork']['dealer_id'] = x However, if the form simply has a text field to enter that information, Cake won't know anything about the existing record. I think the thing to do in this case

Re: Site's home page

2009-08-26 Thread brian
On Wed, Aug 26, 2009 at 11:32 AM, Matias_castromattias.cas...@gmail.com wrote: Yes, I believe that should work. I have one more dought; shouldn't I use the APP/views/pages/home.ctp to build up my home page? Yes, that's what I said. instead of treating the home like any other view? and if

Re: Site's home page

2009-08-26 Thread PaulW
Actually make that... var $uses = array('News'); On Aug 26, 6:19 pm, PaulW willis...@googlemail.com wrote: In the pages_controller.php that Brian talked about you just need to add var $uses = array('news'); at the top http://book.cakephp.org/view/53/components-helpers-and-uses On Aug

Re: Friendly image/files URL routing

2009-08-26 Thread MrMeikel
Thanks! Now I know where to start I will investigate further correct use/mime- types of the function. On Aug 26, 2:30 pm, Jon Bennett jmbenn...@gmail.com wrote: Hi, I am uploading files(images, mp3s etc) to my webroot /files/ folder. The files are named their id number.their extension.

Re: Site's home page

2009-08-26 Thread PaulW
In the pages_controller.php that Brian talked about you just need to add var $uses = array('news'); at the top http://book.cakephp.org/view/53/components-helpers-and-uses On Aug 26, 5:12 pm, Matias_castro mattias.cas...@gmail.com wrote: OK, but, where do I put the logic of that home.ctp? for

Re: Site's home page

2009-08-26 Thread brian
As I said: You can invoke elements inside the view. Have a look at requestAction, for instance. Although, be sure to read this, also: http://mark-story.com/posts/view/reducing-requestaction-use-in-your-cakephp-sites-with-fat-models On Wed, Aug 26, 2009 at 12:12 PM,

Re: Overwrite html link method

2009-08-26 Thread Dr. Loboto
Because link() method is in HtmlHelper, not in Helper itself. Make your own helper, load Html helper there, make method link(), load this helper by default and call it in your views instead of $html-link(). On Aug 26, 3:13 pm, Aurimas Lickus w...@codecard.lt wrote: Hello, What i am doing

Re: Defining custom constants in models

2009-08-26 Thread robert matousek
If it would have been a class constant, you could have accessed it with className::constant, e.g. class MyClass { const constant = 'constant value'; } however, you're defining a global constant in which the variable can be accessed anywhere during the execution of the script just by typing

Re: get profile id when user logs in

2009-08-26 Thread brian
Use $session-read('Auth.User.profile_id') *if* your User model has that field. You haven't explained how the association between User Profile has been set up, so it's difficult to say. On Wed, Aug 26, 2009 at 12:01 PM, Paulos23paulitosthe...@gmail.com wrote: Hello people, I am facing a small

file upload strange - doesn't appear in filesystem, but can be move_uploaded_file()ed

2009-08-26 Thread MrMeikel
Hi, I haven't done any file upload handling for a long time in php, so maybe I am missing something quite obvious here. I have a simple upload form using the form helper that seems to work. My controller then calls a model function called data_upload which is responsible for moving the uploaded

Re: FormHelper Select

2009-08-26 Thread Sarah
Thank you! I really appreciate it. :) On Aug 25, 8:31 pm, delocalizer conrad.leon...@hotmail.com wrote: Hi Sarah; If you declare in your user model file: var $displayField = 'username'; then find('list') returns an array with keys of id's and values of usernames... and then if you have

Help

2009-08-26 Thread bumper
I'm brand new to cake so please be gentle My view look like the following : div id=property ?php echo $form-create('property', array('action' = 'findzip')); echo $form-input('Zip Code'); echo $form-submit(); echo $form-end(); ? /div ?php

Re: get profile id when user logs in

2009-08-26 Thread paulos nikolo
Sry Brian you are right!The relations are: User HasOne Profile and Profile belongsTo User.In profiles table i use the user_id field but in users i didn't use the profile_id.So in order to make your solution work i must add a field with that name,if there is not any other soluton. Many thanks for

Modules in cake?

2009-08-26 Thread Mech7
Is there way to setup modules in cake... I don't mean plugins which are seperate capplications but modules that will hace MVC files... but could also work togheter... for example you can install a Tag module.. and if you install a Pages or Blog modules they could make use of it... all in seperate

Re: Help

2009-08-26 Thread mike karthauser
hi you should turn on debug=2 and have a look at your query. i suspect you aren't returning the value you want to return any data. have you pr($this-data) within your controller action? i suspect your echo $form-input('Zip Code'); field is better named as echo $form-input('zip',

Re: ACL bug when Auth::authorize = 'actions'? 1.2.4.8284

2009-08-26 Thread delocalizer
Hi hb, I don't know if this will reassure you or frustrate you - but it's not a bug in db_acl. Acl with Auth-authorize = 'actions' works nicely for me for a long time, including in 1.2.4.8284. May I ask, in your AppController::beforeFilter, to what you have set the Auth- actionPath? regards, C.

FreeTDS mssql works from php but not from cakephp

2009-08-26 Thread LunarDraco
I have a microsoft SQL server that I need to connect to. It has fields that are of type 'Text' which I can not read or write to with the dbo_mssql.php. This is a Unix-mssql issue for data type 'Text' There are a couple of ways to get around this. one is to load FreeTDS which I have done. I

Re: Friendly image/files URL routing

2009-08-26 Thread Miles J
First off, why dont you just link to the file itself, to the full path like you said in the first part? Secondly, you could just rename the file when uploading also. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Is Cake capable of building up a small or medium social network?

2009-08-26 Thread DigitalDude
Hey, I'm wondering if it would be possible to build up a small a medium social network, just testwise, with CakePHP. Let's say we would have approx 50.000 users and the could connect to each other, could Cake and the DB handle those masses of users and information? How would it be pissible to

Re: FreeTDS mssql works from php but not from cakephp

2009-08-26 Thread LunarDraco
Updated! Solved! I found the problem. I noticed in my php only testconn.php file that I do not specify the port because connecting to the mssql via FreeTDS is a mapping connection, the only thing you need to specify is the name of the map you setup in the /usr/local/etc/freetds.conf file. Mine

Diskussion zu faq

2009-08-26 Thread powtac
Can somebody add http://cakeapp.com to Interesting projects/source code? --~--~-~--~~~---~--~~ 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

Re: Cakephp way to add related items

2009-08-26 Thread #2Will
o, ok. Thanks brian. i think thats a pattern im going to be using heaps, so much appreciated. will On Aug 27, 2:19 am, brian bally.z...@gmail.com wrote: In CommentsController::add() do something like this: if ($this-Comment-validates()) {         if ($this-Comment-save($this-data))        

This Project Has Not Released Any Files

2009-08-26 Thread #2Will
I'm just wondering, why is it most of the items in cakeforge have no files attached? Is that the right place to be looking for plugins, bake scripts, applications etc? It seems odd that so many have been created but without anything being released. Thanks Will

Acl and Auth

2009-08-26 Thread Matias_castro
Hi there. Can anyone tell me what's the difference between $this-Auth- allowedActions and $this-Auth-Acl-Allow?? Will one of them overwrite the other?? Also, I'm having trouble giving free access to everyone to my home page (in app\views\pages\home.ctp) can anyone tell me how to do this? I have

jQuery with Cake forms

2009-08-26 Thread Mike
Hello! I'm looking to use jQuery with Cake, specifically with a form. My plan was to use a DatePicker (http://docs.jquery.com/UI/Datepicker) control instead of the default datetime drop-down menus, but it looks like the easy approach (give the datetime div an id that jQuery's DatePicker

Re: jQuery with Cake forms

2009-08-26 Thread Matt Curry
This one's pretty easy actually...Just set the input to be type text and attach the datepicker to the id of the input (not the div): ?php echo $form-input('field', array('type' = 'text')); ? script type=text/javascript $(function(){ $('#ModelField').datepicker(); }); /script -Matt

Re: This Project Has Not Released Any Files

2009-08-26 Thread Matt Curry
I personally never go to cakeforge. Try: http://bakery.cakephp.org/ http://thechaw.com/projects http://github.com/search?langOverride=q=cakephprepo=start_value=1type=Repositories -Matt http://www.pseudocoder.com On Aug 26, 7:53 pm, #2Will willjbar...@gmail.com wrote: I'm just wondering, why

can a custom validation function return an error message or just true/false?

2009-08-26 Thread JamesF
var $validate = array( 'username' = array( 'customFunction' = array('rule'= 'customFunction', 'message'='user name error', ), ), ); function customFunction($data) { if($data['username'] ==

Re: can a custom validation function return an error message or just true/false?

2009-08-26 Thread Graham Weldon
Rather than trying to return an error message from your validation functions, split up your validation into smaller single purpose validations. Each smaller validation method can be assigned a message to report on failure. $validate = array( 'field_name' = array(