Re: Why is Controller::render so complex?

2007-04-13 Thread gwoo
sounds like a good chance to create some unit tests and submit them along with a patch. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To uns

R: accessing different database from a controller

2007-04-13 Thread m.sbragi
This is a known issue. In your connections in database.php add the clause 'persistent' => false like in this example: class DATABASE_CONFIG { var $global = array( 'driver' => 'mysql', 'connect'=> 'mysql_connect',

curious to know status of jquery in cakephp 1.2 ??

2007-04-13 Thread bingo
Hi, For almost last 1 year, I am using cakePHP and I really enjoy using it. Actually, because of cakePHP, I am able to build a wonderful website for article management (http://www.geovista.psu.edu/memento ). To try, use demo/demo as username and password. However, this message is not about boasti

RE: unable to pass url as a parameter

2007-04-13 Thread Mariano Iglesias
It's not that you *need* them, but that named parameters are SEO friendly while regular are not. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowled

Re: unable to pass url as a parameter

2007-04-13 Thread bingo
Hi MI, great..its working now..after you reply...Probably the problem was due to use of "named parameter code" (http://bakery.cakephp.org/articles/ view/129 ) but I cannot say conclusively However one question ...using controller/action?site=... basically you are passing named parameters in trad

RE: unable to pass url as a parameter

2007-04-13 Thread Mariano Iglesias
No way, that example I give you works with no problem both on 1.1 or 1.2, seems like you have issues on your Server installation. Web server, CakePHP version, etc. etc.? -MI --- Remember, smart coders answer ten questions f

Re: unable to pass url as a parameter

2007-04-13 Thread bingo
Hi MI, thanks for your suggestion. I already tried that and is not working.. If I encode the url then the cake shows page not found error.if you noticed, the first link has encoded url. I also tried using site=urlencode('http://cakephp.org') ... and it is also giving "page not found" error.

Re: Why is Controller::render so complex?

2007-04-13 Thread Dr. Tarique Sani
On 4/14/07, gwoo <[EMAIL PROTECTED]> wrote: > > what happens when you try to validate two different models in the same > controller? Do you get the validation errors for both models in the > view? > With my code yes - with the prior code no... Tarique -- ===

Re: Why is Controller::render so complex?

2007-04-13 Thread gwoo
what happens when you try to validate two different models in the same controller? Do you get the validation errors for both models in the view? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To p

Re: accessing different database from a controller

2007-04-13 Thread cloud
Dear Joshua, They are all mysql tables and residing in a same server. I did some more testing and found that if I changed the $uses in the sites_controller.php: from : class SitesController extends AppController { var $name = 'Sites'; var $uses = array('Site' , 'Language'); } t

Why is Controller::render so complex?

2007-04-13 Thread Dr. Tarique Sani
While investigating how best to get validationErrors of associated models into views (specially hasOne) I ran into this piece of code in the Controller::render method (v1.2.xxx). if (!empty($this->modelNames)) { $count = count($this->modelNames); for ($i = 0; $i <

Re: Creating a support wiki for CakePHP, any interest?

2007-04-13 Thread xbase
Why don't we first develop our own wiki utilizing cake then start plugging in content to the wiki afterwords? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [E

Re: Date Formatting

2007-04-13 Thread EricS
Thank you very much, that solved it! On Apr 13, 8:54 am, "Marcus T. Jaschen" <[EMAIL PROTECTED]> wrote: > EricS wrote: > > I have only spent a few weeks on cakephp but so far I love it. > > However, I have one issue I can't get past. I am having a really hard > > time getting dates formatted. I

Re: accessing different database from a controller

2007-04-13 Thread Joshua Benner
Are they entirely different database backends? What type of databases are they? On Apr 13, 2:24 pm, "cloud" <[EMAIL PROTECTED]> wrote: > Dear all, > > I just started using CakePHP for developing my company website. > Have searched the forum, but couldn't find any info. > > Need to acces 2 tables

Re: Components and Database

2007-04-13 Thread Joshua Benner
Perhaps you could define a method on app/app_controller.php (class AppController) that will store the appropriate information, and have every action call that method ($this->method). Alternately, there may be some method on AppController you could override (and pass to parent) that actually calls

Re: url issues

2007-04-13 Thread Joshua Benner
Does your web host allow .htaccess overriding? That is required for mod_rewrite to work properly. I know there is a way to work without mod_rewrite, but I've not done it myself. On Apr 13, 8:06 pm, "NicoE" <[EMAIL PROTECTED]> wrote: > Hello everybody! I just uploaded Cake to my webhosting. The pr

url issues

2007-04-13 Thread NicoE
Hello everybody! I just uploaded Cake to my webhosting. The problem I have is that I can´t get to the URL: www.domain.com/cake/controller/action. The same page appears: "Your database configuration file is present. Cake is able to connect to the database". --~--~-~--~~~--

RE: unable to pass url as a parameter

2007-04-13 Thread Mariano Iglesias
A quick fix is to use parameters: $html->link('Tag CakePHP website', 'controller/action?site=' . urlencode('http://www.cakephp.org')); And then on your action: function action() { $url = $this->params['url']['site']; } -MI --

How do I use i18n and l10n in CakePHP 1.2?

2007-04-13 Thread Aaron Thies
I have been trying to find any kind of documentation on how to use i18n and l10n in CakePHP 1.2. Any help would be appreciated. -- Aaron Thies "When you're married you'll understand the value of fresh produce." - Tony Soprano --~--~-~--~~~---~--~~ You received

unable to pass url as a parameter

2007-04-13 Thread bingo
hi, I want to allow users to tag any outside website in my application. For this, I am sending the url of the website as a parameter to my controller/action so for instance, http://localhost/mysite/controller/action/http%3A%2F%2Fcakephp.org%2F -- (1) here http%3A%2F%2Fcakephp.or

Odd Queries for Pagination

2007-04-13 Thread Joshua Benner
Please note, I don't know if this is a bug... if feedback suggests it is, then I'll submit a bug report -- but I'd like to seek input from others first. I'm using the scaffolding on a very basic table for inputting some support data. However, the scaffold does not seem to paginate properly, showi

Re: Building criteria array using DATE_FORMAT

2007-04-13 Thread [EMAIL PROTECTED]
Does anyone have any idea how to put together an array to make the DATE_FORMAT work? On Apr 8, 7:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to use a findall query and use the MYSQLDATE_FORMAT > function. > > The code is > > $criteria = array(); > $criteria['DATE_FORMAT(Sch

Re: Populating a hidden field

2007-04-13 Thread [EMAIL PROTECTED]
Yolabingo, You can use cake's pr() command to do the same thing in the controller with much less effort. Just do... pr($this->data) and the first thing that appears in your view is the data dump. Of course, your way allows you to dump the data into a particular div tag if that is needed. Usef

Re: Populating a hidden field

2007-04-13 Thread yolabingo
One thing that has helped me tremendously as I learn this framework is to print the contents of $this->params and/or $this->data when I'm working on a function/view and getting stuck. Just do something like this in your controller (at all points before a view might be rendered): set('currData',

accessing different database from a controller

2007-04-13 Thread cloud
Dear all, I just started using CakePHP for developing my company website. Have searched the forum, but couldn't find any info. Need to acces 2 tables which located in 2 different database from a controller. But, I can't get it to work. I read the manual on accessing more than one model from a co

Re: Populating a hidden field

2007-04-13 Thread ifcanduela
Thank you very much for your help, Scott. Well I've finally managed to get it to work by placing things like this: function add($region_id = null) { if (!empty($this->data)) { $this->data['Country']['region_id'] = $region_id; if ($this->Country->s

Re: Pagination through requestAction

2007-04-13 Thread gwoo
when in doubt, you can always pass the controller. try setting $paginator- >options(array('url'=>array('controller'=>'controllerName'))): There was a ticket on this before and I tested it. Try to search https://trac.cakephp.org and see if the previously reported problem is similar to yours. --

Re: Pagination through requestAction

2007-04-13 Thread sickrandir
Your article on the bakery is great. The only thing I miss is controlling the pagination through the paginator helper. Is there any way to use the functions $paginator->prev and $paginator->next with the requestAction approach? I tried but the links generated alway refers to the controller associa

Re: creating static links to documents

2007-04-13 Thread Joshua Benner
I'm not sure if this is right, but I would personally just put in the static HTML in the view if it's going to be static content. As for where to put the documents, put the somewhere accessible from the web (perhaps somewhere under app/webroot, or somewhere else if you have a system in place). Li

creating static links to documents

2007-04-13 Thread jyrgen
hi all, i am wondering how to create static links with the link helper (for example to a pdf) and where to put the files. $html->link always renders http://host/cake/index.php/controller/action which i don't want in this case. thank you ! jyrgen --~--~-~--~~~---~--~--

Usage of query()

2007-04-13 Thread Joshua Benner
>From glancing at the code (1.2), it seems that model::query() can do more than just take a string argument. Is there anywhere that has details as to the possible syntax for the query() function, or should I wade through the code and figure it out? :) I'm using it because I need to pull all the p

Re: Populating a hidden field

2007-04-13 Thread [EMAIL PROTECTED]
Your add function shouldn't really need a parameter associated with it. Edit/View/Delete controller actions use it, but there is no id associated with an add. When you call add, you are calling /country/ add without a parameter, but your $region_id = null section is defaulting it to 0. I'm assu

Re: Populating a hidden field

2007-04-13 Thread ifcanduela
Ugh, I'm such a newbie... The view gets the value for region_id OK, but when I submit the form, it inserts a 0 in the region_id field of the new record instead of the real region_id. Am I missing something? Thanks in advance. --~--~-~--~~~---~--~~ You received t

Re: cake 1.2 paginator modificaions

2007-04-13 Thread Humble Groups
This is what I did. Page counter(); ?>  current() != 1) { $this->params['pass']['page'] = 1; echo $paginator->link("<< First", $this->params['pass'])." | "; } else { echo "<< First | "; } ?> prev('< Previous', null

Re: Populating a hidden field

2007-04-13 Thread ifcanduela
Wow, thanks everybody. I've moved the set() call to the 'else' clause instead of putting it before the 'if' and it works like a charm now. I guess I still have to learn the mechanics of it all. And Scott, thank you for pointing me that, it wasn't a typo, I had it that way in the code. --~--~---

Re: What is the best source for CakePHP v1.2 documentation?

2007-04-13 Thread Dr. Tarique Sani
On 4/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > What and where is doxygen? http://www.google.co.in/search?q=doxygen First link T -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog needs you!: http://cheesecake-

Re: Date Formatting

2007-04-13 Thread Samuel DeVore
You might also look at the Time helper some great functions there http://manual.cakephp.org/chapter/helpers and in the api http://api.cakephp.org/class_time_helper.html HTH Sam D On 4/13/07, Marcus T. Jaschen <[EMAIL PROTECTED]> wrote: > > EricS wrote: > > I have only spent a few weeks on ca

Re: Populating a hidden field

2007-04-13 Thread [EMAIL PROTECTED]
It might be a typo but you have a period instead of a comma on the line $this->set('region_id' . $region_id); function add($region_id = null) { if (!empty($this->data)) { $this->set('region_id' , $region_id); if ($this->Country->save($this->data))

Re: Populating a hidden field

2007-04-13 Thread yolabingo
On Apr 13, 7:03 am, "ifcanduela" <[EMAIL PROTECTED]> wrote: This is my add function, almost straight from the blog tutorial: > > function add($region_id = null) > { > if (!empty($this->data)) > { > $this->set('region_id' . $region_id); > if ($this-

Re: Autocompletion Options

2007-04-13 Thread Romain BOSSUT
I need to do exactly the same thing. Anyone has found a solution ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this gr

Re: What is the best source for CakePHP v1.2 documentation?

2007-04-13 Thread [EMAIL PROTECTED]
What and where is doxygen? On Apr 12, 9:44 pm, "Copongcopong" <[EMAIL PROTECTED]> wrote: > try to download doxygen to parse the documentation off the cakePHP 1.2 > source. > > On Apr 13, 3:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:> OK, I am > probably doing something else wrong then.

Re: Populating a hidden field

2007-04-13 Thread Hawk|
Hi, if you use this [code] if (!empty($this->data)) { $this->set('region_id' , $region_id); if ($this->Country->save($this->data)) { $this->flash('New country added.', '/countries', 2); } } [/code] that mean

Components and Database

2007-04-13 Thread Vincent
Hello - I am kind of new to Cake and I am unsure about how to structure a piece of development I need to do. I want to create a Tracker feature whereby I will track users actions on my website. It is fairly simple: - when a user first arrive on the site, I record his IP in a session and on a "us

Re: how should I set up these complex associations?

2007-04-13 Thread gerbenzomp
You mean in the model? I've tried that before, but it doesn't change the error. I think there's something wrong with my associations in general, because I get an array that looks different from what I had hoped for, and the error stays too. (It goes away when I remove the page->widget association

Populating a hidden field

2007-04-13 Thread ifcanduela
Hello, I'm new to CakePHP and have what I think is a very simple question, but I'm apparentyly unable to find a straight answer anywhere. I have a couple of MySQL tables, regions and countries, and I have already setup models, views and controllers for both of them, so I can display tables listin

Re: Date Formatting

2007-04-13 Thread Marcus T. Jaschen
EricS wrote: > I have only spent a few weeks on cakephp but so far I love it. > However, I have one issue I can't get past. I am having a really hard > time getting dates formatted. I searched this group but wasn't able > to get anything working. > > The date is stored in the database as a date

Re: how to add tracking code in new flash lay out

2007-04-13 Thread Dr. Tarique Sani
You may never know what results come of your action, but if you do nothing there will be no result. - Mahatma Gandhi On 4/13/07, rajasekhar <[EMAIL PROTECTED]> wrote: > > Hallo, > > i want to add tracking code in new flash layout, how to add it, and > how to access it. > > urs, > rajasekhar. > >

Re: how to add tracking code in new flash lay out

2007-04-13 Thread Gonzalo Servat
On 4/13/07, rajasekhar <[EMAIL PROTECTED]> wrote: > > > Hallo, > > i want to add tracking code in new flash layout, how to add it, and > how to access it. > Rajasekhar, Please don't take this in a bad way, I just thought I'd give you a word of advice since you're fairly new to the group and you

how to add tracking code in new flash lay out

2007-04-13 Thread rajasekhar
Hallo, i want to add tracking code in new flash layout, how to add it, and how to access it. urs, rajasekhar. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to

Re: Passing data between models

2007-04-13 Thread haj
I would simply add "is_approved" field to userAdmin table... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group,

Re: cake 1.2 paginator modificaions

2007-04-13 Thread byBartus
Hi, What I made to achieve the page numbers was simpler than to hack the core, as Nate explained in another one thread. in the view (list.ctp) === params(); echo $paginator->prev('<< Prev'); echo ''; for ($i = 1; $i <= $params['pageCount']; $i++) {

Re: how should I set up these complex associations?

2007-04-13 Thread Mike Griffin
On 4/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > But I think this isn't the right approach, because I get the error: > SQL Error in model Page: 1052: Column 'id' in order clause is > ambiguous You need to use the model name in front of the id as well. Something like Page.id or Widget.id, depen

Re: how should I set up these complex associations?

2007-04-13 Thread gerbenzomp
I'll try to be a bit more specific: my main problem is that a Widget belongs only to the combination of layer and page, and is linked through layer_id and page_id. A page in turn only has an association with a layer through the design model. Right now I have this: class Page extends AppModel { v

Re: brainstorming: associations for user types?

2007-04-13 Thread R. Rajesh Jeba Anbiah
On Apr 13, 3:39 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 4/13/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > > This is what I would do but probably a better solution exists > > > 1. I'm totally lost what should be the foreign key in other tables, > > say transactions? > >

Re: brainstorming: associations for user types?

2007-04-13 Thread Dr. Tarique Sani
On 4/13/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: This is what I would do but probably a better solution exists > 1. I'm totally lost what should be the foreign key in other tables, > say transactions? >user_id or admin_id/clerk_id/waiter_id ? user_id and for a good measure I wou

brainstorming: associations for user types?

2007-04-13 Thread R. Rajesh Jeba Anbiah
Situation: Say for the restaurant website, I have user types: admin, clerk, and waiter and they have different kind of profile pages. Current setup: * users table with common fields for all user types (mostly othAuth users table) * profiles are maintained in admins, clerks and waiters table wit

Email Component - sendAs 'both'

2007-04-13 Thread thequietlab
Does anybody managed to send a proper email using sendAs='both' ? I mean, the email get sent though it doesn't render in Outlook. When I take a look at the content it looks fine, let me show you : --2c465d8ee9966e81e9538e3c53d623d2 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-E

Re: Storing settings / Persistent data

2007-04-13 Thread CraZyLeGs
http://bakery.cakephp.org/articles/view/243 On Apr 12, 6:44 am, "AD7six" <[EMAIL PROTECTED]> wrote: > On 10 abr, 15:48, "cherrio" <[EMAIL PROTECTED]> wrote: > > > > > Hey All, > > > a question about persistent data. I was using a Config method that I > > got from the old Wiki, but when I upgraded

Re: how to create new flash layout and a corresponding function

2007-04-13 Thread rajasekhar
hallo Gerben, thank you for the reply, its useful, On Apr 13, 12:21 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > Take a look at RosSoft's excellent > pdf:http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/ > > It contains a section about how to create your own custom flash

Re: CakePHP on shared hosting

2007-04-13 Thread AD7six
On 13 abr, 09:31, "mark-magoo" <[EMAIL PROTECTED]> wrote: > I have a shared hosting account through Aplus ( i know not the best > hosting). But since i have an account there i'd like to setup cakePHP > if possible. The problem is i only have a html folder , no www, or > root or var..is

Re: What does define('LOG_ERROR', 2); do?

2007-04-13 Thread redhex
Cool. it is a error constant. Maybe that should go into the comment in the code. Else some one else will go down this path which I had taken! Chin Yong http://www.ablewise.com On Apr 12, 9:46 pm, "nate" <[EMAIL PROTECTED]> wrote: > It basically fills in for PHP on an error constant that's not th

CakePHP on shared hosting

2007-04-13 Thread mark-magoo
I have a shared hosting account through Aplus ( i know not the best hosting). But since i have an account there i'd like to setup cakePHP if possible. The problem is i only have a html folder , no www, or root or var..is there any way i can get cakephp to work on a shared hosting account