Re: validation in model

2008-11-30 Thread David C. Zentgraf
What you're looking for is this: http://book.cakephp.org/view/131/on On 1 Dec 2008, at 16:06, AngeloZanetti wrote: > > > Hi all, > > Is it possible to have model validation only be called when there is > an add > action and not edit for example ? > > I have added unique name validation but now

Re: jquery && prototype

2008-11-27 Thread David C. Zentgraf
http://docs.jquery.com/Using_jQuery_with_Other_Libraries On 28 Nov 2008, at 12:10, Diego Villar wrote: > boys, > > I am with a problem > > In one of my pages I use jQuery to launch windows thickbox, now I am > on the > need to send a form via ajax on that same page, I wanted to use > prototy

Re: RSS Feed ... what method is called by index.rss

2008-11-25 Thread David C. Zentgraf
I guess the idea is that the index page and the index RSS feed should very much contain the same data, only in a different output format (layout/view). You can use a paginate() call even for the RSS feed, as you usually only want the last x entries in the feed, not the whole database. You

Re: how to check the path of your cache view in the source code?

2008-11-25 Thread David C. Zentgraf
Have you set the correct permission levels on the tmp directories (web server needs write access)? On 25 Nov 2008, at 17:53, robert123 wrote: > > hi > > I have enabled caching, in my testing environment, the cache is > working well, and generate the views at tmp/cache/views > > so i deploy the

Re: Modrewrite for folder containing wusage

2008-11-24 Thread David C. Zentgraf
You can place the folder in Cake's webroot folder. Alternatively, see here: http://stackoverflow.com/questions/3157/htaccess-directives-to-not-redirect-certain-urls On 25 Nov 2008, at 08:14, Kut Jegan wrote: > > Hello, > > on my webserver in /wusage a tool to analyze statistics and requestes > t

Re: calling exit() after redirect STILL redirects

2008-11-24 Thread David C. Zentgraf
On 25 Nov 2008, at 06:34, _Z wrote: > However when the form is submitted to login, they are instead > redirected back to the register view. That means your register form AND login action both work fine? Only after logging in the user goes back to the register view? By default the Auth compon

Re: String conversion

2008-11-19 Thread David C. Zentgraf
Somewhere in the data you're trying to save there's an array where there should be a string. E.g. array( 'Model' => array( 'field1' => array( ... ) ) ) instead of array( 'Model' => array( 'field1' => 'This should be a simple string'

Re: Ways to display data from another controller without resorting to requestAction?

2008-11-18 Thread David C. Zentgraf
http://book.cakephp.org/view/63/Introduction On 18 Nov 2008, at 16:55, Pizgin wrote: > > David tell me please more detail. Thanks. > > On 18 нояб, 10:31, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> How about making a reusable component? >> &

Re: Ways to display data from another controller without resorting to requestAction?

2008-11-17 Thread David C. Zentgraf
How about making a reusable component? On 18 Nov 2008, at 16:22, Pizgin wrote: > > Hi! What else there are ways to display data from another controller > instead of using requestAction? Thanks. > > --~--~-~--~~~---~--~~ You received this message because you are

Re: difference in model and controller name

2008-11-17 Thread David C. Zentgraf
> var $name = 'Category '; ^ Get rid of the extra space, then your model name should inflect properly (and eliminate a million other possible headaches). On 18 Nov 2008, at 07:43, introvert wrote: > > I'm using the latest cakephp (downloaded it a mome

Re: How to apply permission to XML folder in webroot

2008-11-16 Thread David C. Zentgraf
You'd do this on the server side by setting file system permissions or with .htaccess directives (hardly a Cake question). The better thing to do though would be to not put it in the webroot to begin with, if it's not supposed to ever be accessed. On 17 Nov 2008, at 16:33, bookme wrote: > >

Re: Can't use internationalization on input label

2008-11-15 Thread David C. Zentgraf
echo $form->input('names', array( 'label' => __('Names', true))); On 16 Nov 2008, at 13:15, Mateo San Román wrote: > > Hello > > When I try to use the __() function on > > echo $form->input('names', array( 'label' => __('Names'))); > > on a view, the output shows both default table field name AN

Re: How change url from paginator

2008-11-13 Thread David C. Zentgraf
Ignore the Camel Case Guy... What you're looking for was discussed here recently: http://groups.google.com/group/cake-php/browse_thread/thread/3f6a92d35769f7c3/ On 14 Nov 2008, at 10:10, Xavier Mathews wrote: > Those Links Dont Work But The Did Come With An Erorr MSG That I Can > Run For You!

Re: Finding the page that a specific record appears

2008-11-12 Thread David C. Zentgraf
Shouldn't be too hard. Get the ids of all records with the same conditions as used by paginate, find out at which position your id is, divide by number of records per page. There's probably a way to do it all in SQL, without parsing everything in PHP. The problem is, depending on your datas

Re: how to validate the empty fileds in cakephp

2008-11-12 Thread David C. Zentgraf
> "the missing all fields will shown error message..but no one > displayed." I don't understand, can you express that differently? On 12 Nov 2008, at 16:24, sun wrote: > > Thanks for consider my request. > > I am asking abt how to validate the empty form fields and upload > file filed. ?

Re: how to validate the empty fileds in cakephp

2008-11-11 Thread David C. Zentgraf
Hi Sun, Please send your replies to the list. I think you need to read through the book again to understand how to properly use validation rules. http://book.cakephp.org/view/127/One-Rule-Per-Field Chrs, Dav On 12 Nov 2008, at 16:42, sun wrote: > Thanks for consider my request, > I am ask

Re: how to validate the empty fileds in cakephp

2008-11-11 Thread David C. Zentgraf
I don't understand what exactly you mean, but you may wanna look into allowEmpty or notEmpty: http://book.cakephp.org/view/130/allowEmpty http://book.cakephp.org/view/740/notEmpty On 12 Nov 2008, at 14:58, sun wrote: > > How to validate the empty fileds in cakephp ? when i dont give any > valu

Re: Queries based on

2008-11-11 Thread David C. Zentgraf
This should certainly work: $this->set('events', $this->Event->find('all', array('conditions' => array('Event.associate_id' => $curr_user["Associate"]["0"]["id"]; Good flight! WEe~ On 12 Nov 2008, at 08:59, lirc201 wrote: > > Hello All, > > I need a little push off the cliff h

Re: Pagination and Reverse Routing

2008-11-10 Thread David C. Zentgraf
Try: Router::connect('/dashboard/watching/*', array('controller' => 'watching', 'action' => 'index')); Notice the final /*. For pagination links several args have to be appended to the URL, so it doesn't match "/dashboard/watching" anymore. Chrs, Dav On 11 Nov 2008, at 15:26, benko wrote:

Re: Alt text?

2008-11-09 Thread David C. Zentgraf
image('icon.gif', array('alt' => $text . $phone['Phone'] ['phonenumber'], 'title'=> $text . $phone['Phone']['phonenumber']))); ?> Does that help? On 10 Nov 2008, at 10:21, thankyou wrote: > > Any help on this is greatly appreciated :) > > I want to add additional text to the alt and title code

Re: Difference between read and find

2008-11-06 Thread David C. Zentgraf
read() sets the data in the model, find() does not. http://api.cakephp.org/class_model.html#da9914325847e7a03320eafb691208da I.e. $Model->find(); echo $Model->data; // empty $Model->read(); echo $Model->data; // not empty Personally I never use read() either. On 6 Nov 2008, at 17:54, Lieberman

Re: Creating DatabaseTables (cakephp way)

2008-11-05 Thread David C. Zentgraf
In this case you'll have to tell Cake what the primary key is: http://book.cakephp.org/view/437/primaryKey Why would you want to name it this way though? An "id" column in the Category table is obviously going to be the "Category.id". "Category.category_id" seems pretty redundant to me, and i

Re: Returning a model variable

2008-11-04 Thread David C. Zentgraf
On 4 Nov 2008, at 23:47, Mathew wrote: > class Document extens AppModel > { > var $foo; > > function afterSave() > { >. >$foo = "something"; $this->foo = "something"; > } > } > > in your controller > > $this->Document->save($data); > echo $this->Document->foo; FTFY. --~--~---

Re: Using $this->ModelA->ModelB->find('list') with belongsTo conditions on ModelA.

2008-11-04 Thread David C. Zentgraf
Doing ModelA->ModelB->find() is the same thing as ModelB->find(). It doesn't matter "through" which or how many models you go, it doesn't change the result. Which means, the conditions and associations you have defined in ModelB are being used here, so check those. On 4 Nov 2008, at 20:07, Ia

Re: Pagination with HasMany and SQL Aggregation

2008-11-03 Thread David C. Zentgraf
I needed to that a little while ago and got it to work with some slightly ugly hacking that probably doesn't scale too well, but it might work for you too. :) This belongs in the controller: http://bin.cakephp.org/view/1990384829 On 4 Nov 2008, at 13:20, mwcbrent wrote: > > I'm not sure tha

Re: AW: Turn off inflections

2008-10-30 Thread David C. Zentgraf
nown modifier > '.' > '/^.*ive$/' gives preg_match() [function.preg-match]: Unknown > modifier '^' [CORE\cake\libs\inflector.php, line 258] > > Any idea what the correct syntax could be? > > Thank you in advance! > > Anja > > -Urs

Re: Search Engine Bots Generating Strange Queries

2008-10-30 Thread David C. Zentgraf
I'm totally no expert on this, but I'd guess that the bots are simply trying to walk the tree. If "http://mysite.com/directory/subdirectory/subsubdirectory"; is valid, then "http://mysite.com/directory/subdirectory";, "http://mysite.com/directory " and "http://mysite.com"; are probably also

Re: CakePHP conference in Tokyo 2008 - report

2008-10-29 Thread David C. Zentgraf
let us post the news at this google group. > > Still, you can watch Garrett's talk at > > CakePHP and Beyond / Garrett J Woodworth (Cake Software Foundation), > phpstudy Ustream.TV: > http://www.ustream.tv/recorded/811617 > > Whole program: > http://www.ustream.tv/

Re: Array truncates after first letter

2008-10-29 Thread David C. Zentgraf
Double check what you're actually doing: > foreach ($popular[2]['Project'] as $project) means you're going over the fields inside $popular[2]['Project']. The first time $project will be "Gallery" (the first field inside ['Project']). The next time it'll be "This is for testing" and so on. T

Re: Turn off inflections

2008-10-29 Thread David C. Zentgraf
Try putting the words you do not want inflected in the $uninflectedPlural array. Gruß, Dav On 30 Oct 2008, at 01:33, Liebermann, Anja Carolin wrote: > > Hi all, > > I just encountered an error in my program due to inflections. > > My model is called "Uebsmwinklusive", it uses the table > "ueb

Re: Fetching ACO

2008-10-29 Thread David C. Zentgraf
Off the top of my head I have used this quite a while ago: $this->Acl->Aco->findAll(); $this->Acl->Aco->generatetreelist(); I'd venture the guess that $this->Acl->Aco->find('threaded') should work too. On 29 Oct 2008, at 16:18, jst4fun wrote: > > Hello all, > I am trying to fetch the list of

Re: Using the Tree behavior

2008-10-27 Thread David C. Zentgraf
See this article to understand what the lft/rght values are for: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html You can use the TreeBehavior::recover method to generate these values for an already existing tree. On 28 Oct 2008, at 07:36, [EMAIL PROTECTED] wrote: > > I'm h

Re: CakePHP conference in Tokyo 2008 - report

2008-10-27 Thread David C. Zentgraf
I wish you would've posted this to the list before the conference, I live just three stations from where it took place. Or did I miss the announcement...? ^_^;; Chrs, Dav On 27 Oct 2008, at 09:45, sdozono wrote: > > Hello, CakePHP users. > > Last Satureday, we had a CakePHP conference in To

Re: user name on default.ctp

2008-10-26 Thread David C. Zentgraf
You can use $session->read('Auth.User') and/or $session- >read('Auth.User.username') in the view. Also, do NOT echo any HTML from the controller. It violates the MVC pattern and the echo'd HTML will always come before anything else, i.e. even before , which is even wronger. Chrs, Dav On 27

Re: Habtm fetching data

2008-10-23 Thread David C. Zentgraf
If you search for an Auction, Cake will automatically get you all the linked Categories with it, and vice versa. So if you want to find all Auctions in Category X, do $this->Category->find( /* appropriate conditions here */ ); and you'll get the correct Category and all Auctions linked with it.

Re: Recursion

2008-10-22 Thread David C. Zentgraf
s, but there is > a problem when i was trying it in a separate project it works as i > need but when i integrate it in my project it gives me an sql error i > don't know why is that problem coming please help me > > On Oct 20, 7:31 am, "David C. Zentgraf" <[EMAIL P

Re: I'm having a problem with containable

2008-10-21 Thread David C. Zentgraf
Please refrain from spamming this list until you are less confussed, thanks. Chrs, Dav On 22 Oct 2008, at 11:53, Xavier Mathews wrote: > Nope I am so confussed but i will look into it deeper. --~--~-~--~~~---~--~~ You received this message because you are subs

Re: I'm having a problem with containable

2008-10-21 Thread David C. Zentgraf
> 'contain' => array('ListLink', array( Try: 'contain' => array('ListLink' => array(... Make a connection between 'LinkList' => and => it's => array(). The way you wrote it it's two separate parameters... On 22 Oct 2008, at 06:43, Stinkbug wrote: > > I think my code looks almost exactly like

Re: PHP Editor

2008-10-20 Thread David C. Zentgraf
+1 for TextMate with ProjectPlus (http://ciaranwal.sh/category/ textmate) plugin. On 20 Oct 2008, at 15:46, Matthieu wrote: > > Hello, I'd like to know which project editor you would recommend. I'm > planning to make a web application using the CakePHP framework. > > > --~--~-~--~

Re: what does this do exactly? examples?

2008-10-19 Thread David C. Zentgraf
Maybe you should look into what a framework is. http://en.wikipedia.org/wiki/Web_application_framework "A web application framework [...] aims to alleviate the overhead associated with common activities used in Web development. For example, many frameworks provide libraries for database acces

Re: i need http://site.com/2/page:3 instead of http://site.com/controller/action/2/page:3

2008-10-19 Thread David C. Zentgraf
If you create appropriate Routes, the PaginationHelper will pick the first one that matches. Maybe what you're overlooking is that the route needs to have a trailing asterisk for the page parameter. /:id/* will match /2/page:3, only /:id/ won't. On 19 Oct 2008, at 22:56, mclight wrote: > > H

Re: Recursion

2008-10-19 Thread David C. Zentgraf
http://book.cakephp.org/view/91/Tree On 19 Oct 2008, at 20:10, mirfan wrote: > > Hi, > I have a problem with recursion. I have a table for keeping the > account information of all members in which each member has a parent > now i have to find out all of the members in the downline of a > specifi

Re: error message on select box validation

2008-10-19 Thread David C. Zentgraf
If you use $form->input(), it will create everything for an input field, including label and error messages. If you use the more specialized select() you'll have to create labels and error messages yourself. See FormHelper::error(). http://api.cakephp.org/class_form_helper.html On 20 Oct 20

Re: Problem with hasMany and belongsTo

2008-10-19 Thread David C. Zentgraf
Don't you mean that each Immobilie hasMany Anhänge, and every Anhang belongsTo an Immobilie? I.e. your Anhänge model is correct, but the Immobilie model is wrong. On 19 Oct 2008, at 03:35, havanna wrote: > > Hi together, > I started with cakePHP and I'm a bit confussed about the relations > hasM

Re: Newbie: What is the "proper" way of rendering views within views?

2008-10-16 Thread David C. Zentgraf
I don't see the problem with using elements, that's exactly what they were made for. Layouts: outer wrapper, same for all pages (or very few different variations) Views: the actual "page", usually one per action Elements: re-usable pieces of a view that are the same on many pages You can put

Re: How to use helpers??

2008-10-16 Thread David C. Zentgraf
on you're using: http://api.cakephp.org/1.1/classes.html On 17 Oct 2008, at 14:22, xelios wrote: > Your links refer to v1.2 > > But m working on v1.1 > > On Oct 17, 9:34 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> http://groups.google.com/group/cake-p

Re: How to use helpers??

2008-10-16 Thread David C. Zentgraf
http://groups.google.com/group/cake-php/browse_thread/thread/560bceab6131f7ca http://groups.google.com/group/cake-php/browse_thread/thread/e88b06c5ce6e91a8 On 17 Oct 2008, at 12:56, xelios wrote: > > m using v1.1.x > > > Following is the error: > > Fatal error: Call to undefined method FormHelpe

Re: Data validation from URL

2008-10-16 Thread David C. Zentgraf
Think twice about what's actually going on in that code... If no $id or $secretid were supplied, you redirect somewhere else. If $this->data is not empty... doesn't matter. Then, last case that always gets triggered if there's ANY $id or $secretid, you fetch the data from the DB and present it

Re: Data validation from URL

2008-10-16 Thread David C. Zentgraf
just messing around > with some of the code that was baked up for me but it's not working. > How do you call a single item from the database? > > > On Oct 16, 1:28 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> Think twice about what's actually goi

Re: How to Handle Special Fields on $this->query() statements - Forking from "MySQL Having Clausule "

2008-10-15 Thread David C. Zentgraf
Very helpful piece-o-code, thanks grigri. :) On 15 Oct 2008, at 19:07, grigri wrote: > > Heh, looks like that one was mine [copied from > http://i-love-cake.pastebin.com/f78d0639a > ] > > > On Oct 15, 4:13 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrot

Re: Move existing app to Subversion

2008-10-15 Thread David C. Zentgraf
http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.export.html http://subversion.tigris.org/mailing-lists.html Chrs, Dav On 15 Oct 2008, at 18:04, oleonav wrote: > > Hi there, > > I am also using subversion to mamage development of apps. > > My setup is: > - Central subversion server; Manages

Re: Mysql Error when trying to execute a function in the model

2008-10-14 Thread David C. Zentgraf
et it to work and that is when > i changed it to Users. Sorry for the confusion. > > On Oct 14, 11:18 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> On 15 Oct 2008, at 12:08, Earl0983 wrote: >> >>> $this->Users->validateUserLogin($this->d

Re: Mysql Error when trying to execute a function in the model

2008-10-14 Thread David C. Zentgraf
On 15 Oct 2008, at 12:08, Earl0983 wrote: > $this->Users->validateUserLogin($this->data['User']) ) ^^ Model names are usually singular. Chrs, Dav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: How to Handle Special Fields on $this->query() statements - Forking from "MySQL Having Clausule "

2008-10-14 Thread David C. Zentgraf
I can't find the author anymore, but this extended MySQL driver was pasted in the bin a while back (I think). Pasting it again. http://bin.cakephp.org/view/443659159 // Extended 'resultSet' to allow alias processing // Fields should contain '((something)) AS Model__field' Hope this helps. On

Re: Filtering controller

2008-10-14 Thread David C. Zentgraf
http://book.cakephp.org/view/542/Defining-Routes Your route would look something like: Router::connect('/countries/:country_id/cities/*', array('controller' => 'cities', 'action' => 'someCityAction')); The 'country_id' will be available in $this->params in the controller. On 15 Oct 2008, at

Re: Associations for multiple tables/models

2008-10-12 Thread David C. Zentgraf
I stand corrected, didn't think of that workaround (not sure I'd call it a feature). Would be great if Cake would recognize these potentials for optimization automagically... On 12 Oct 2008, at 23:00, AD7six wrote: > On Oct 12, 3:04 pm, "David C. Zentgraf" &l

Re: Associations for multiple tables/models

2008-10-12 Thread David C. Zentgraf
is no way > for cake to handle this automatically or are you now aware of how to > do it ?:) > > On Oct 12, 3:49 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> On 12 Oct 2008, at 21:39, jkritikos wrote: >> >>> What should i do so that

Re: Associations for multiple tables/models

2008-10-12 Thread David C. Zentgraf
On 12 Oct 2008, at 21:39, jkritikos wrote: > What should i do so that i get the data for A+B+C in one query? Write your own query. Chrs, Dav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post

Re: In controller using too many models hit the performance?

2008-10-11 Thread David C. Zentgraf
Yes, the more models you use, the more overhead there is. Not only in terms of database hits, but simply the fact that an additional class needs to be included and loaded. So design your database and models wisely from the start. Having said that, this overhead is often negligible, except f

Re: HABTM & Belongs_To Together?

2008-10-11 Thread David C. Zentgraf
A HABTM relationship will fetch data differently then a belongsTo relationship. HABTM will get you an array with multiple results, belongsTo just a "flat" array. $habtm = array( [0] => array(['id'] =>, ...), [1] => array(['id'] =>, ...) ) $belongsTo = array(['id'] =>, ...) Whe

Re: Controller/Model Question

2008-10-10 Thread David C. Zentgraf
All you need to do is insert the post_type into the data array before saving it to the database. Either insert a hidden field into the form that you use to create the post, or insert it in the controller. $this->data['Post']['post_type'] = 'news'; $this->Post->save($this->data); On 11 Oct 20

Re: Querying Unrelated Models from a Controller

2008-10-10 Thread David C. Zentgraf
What you're looking for is $uses. http://book.cakephp.org/view/53/components-helpers-and-uses Or alternatively: App::import('Model', 'OtherModel'); $othermodel = new OtherModel(); On 11 Oct 2008, at 09:56, Wayne wrote: > > This might be a simple question, but everything I'm trying is not > work

Re: Instance methods in Models

2008-10-09 Thread David C. Zentgraf
Yeah you're right, Cakes models are DAOs. That is due to objects carrying a certain overhead in PHP (4), whereas they're virtually free in Ruby. There have been discussions about this before on the list. IIRC, Cake is slated to become OO by 2.0. I'd still say your question was aimed at (in

Re: AppController being ignored

2008-10-09 Thread David C. Zentgraf
Paste your EventsController too... On 10 Oct 2008, at 00:06, Fibra wrote: > > Hello Everyone, how are you? > > I've read this issue in other posts but most of the solutions are > becouse they've updated to a newer version. > > Since I just downloaded the latest stable version on cake, > cake_1.

Re: Instance methods in Models

2008-10-09 Thread David C. Zentgraf
Not quite sure if "instance methods" is the right term for what you're asking for, but anyway. Look into Model::read() and Model::set(); A Model::find() will only return the data, it will not persist it in the model instance. set() is used to, well, set data inside the model, i.e. it will b

Re: Getting route-URL for internal controller/action-URL

2008-10-09 Thread David C. Zentgraf
I believe what you're looking for is $html->url() or, more direct, Router::url(). http://api.cakephp.org/class_router.html#a34cdc409ebe46302682fb8c242c4838 Also, you should lookup URLs with an array like array('controller' => 'groups', 'action' => 'something') instead of /groups/something. Seem

Re: Non alphanumeric chars breaks $validate error messages

2008-10-08 Thread David C. Zentgraf
Just tested with some UTF-8 Japanese and it works, so it's not a problem in general. I'd investigate along the same lines as this recent thread: http://groups.google.com/group/cake-php/browse_thread/thread/0ea507c127fd2ab9 Try a simple echo "Descripción"; from anywhere. Does that display correc

Re: Install cake on leopard, but not the docroot

2008-10-08 Thread David C. Zentgraf
Yes you can, but you'll have to tell Apache that it should care about ~/cakeSites as well. You'll have to create a new Directory or VirtualHost directive in a config file in /etc/apache2/users. Is there a particular reason you want to go through this trouble? :-) On 9 Oct 2008, at 03:43, dot

Re: Encryption/Decryption of data

2008-10-08 Thread David C. Zentgraf
> - public key encryption (Algorithms: RSA, ElGamal, ...) >>read:http://en.wikipedia.org/wiki/Public-key_cryptography >>You should combine those algorithms with traditional >> cryptography (i.e. >> AES) - called hybrid cryptography >> - secret sharing

Re: Tutorial - How make associations between models on different database

2008-10-08 Thread David C. Zentgraf
would work for hasMany. But for hasOne, belongsTo > and (I think) HABTM Cake joins the tables to get the data in a single > query. Does Cake honor useDbConfig in these cases? > > /Martin > > > On Oct 8, 1:08 pm, "David C. Zentgraf" <[EMAIL PROTECTED]>

Re: Tutorial - How make associations between models on different database

2008-10-08 Thread David C. Zentgraf
Set up multiple database connections in database.php. http://book.cakephp.org/view/40/Database-Configuration Configure your models to use the appropriate connection. http://book.cakephp.org/view/435/useDbConfig The associations between models work exactly the same, no extra work needed. On 8

Re: Is there ANY way to insert page-specific code in to $scripts_for_layout??

2008-10-08 Thread David C. Zentgraf
variable; it's called > from HtmlHelper::css() and whatnot. > > hth > grigri > > On Oct 8, 3:19 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> I'm using the HeadHelper to do exactly what you want to >> do.http://rossoft.wordpress

Re: executing shell scripts

2008-10-08 Thread David C. Zentgraf
t; > > On Wed, Oct 8, 2008 at 2:54 AM, David C. Zentgraf <[EMAIL PROTECTED]> > wrote: > >> >> Just to make sure: >> Your code is inside tags, is it? >> >> On 7 Oct 2008, at 21:53, Ryan McKillen wrote: >> >>> I am using cloud.php as t

Re: executing shell scripts

2008-10-07 Thread David C. Zentgraf
Just to make sure: Your code is inside tags, is it? On 7 Oct 2008, at 21:53, Ryan McKillen wrote: > I am using cloud.php as the filename. And just to be safe, I changed > to var > $uses = array(); in case there was a problem with my model. Am I > executing > the shell properly? > > cd ~/cak

Re: Encryption/Decryption of data

2008-10-07 Thread David C. Zentgraf
I'm very interested in this topic. I have an application that by it's nature shares "objects" between multiple participants, each object having different participants. Since those objects contain sensitive data, I was looking into ways to encrypt those, so that not even the database admin c

Re: Is there ANY way to insert page-specific code in to $scripts_for_layout??

2008-10-07 Thread David C. Zentgraf
I'm using the HeadHelper to do exactly what you want to do. http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/ On 8 Oct 2008, at 11:16, BrendonKoz wrote: > > Ah, teknoid... I've seen that solution before, albeit with different > variable names, but that would be the exac

Re: Cake php Controller Structure

2008-10-07 Thread David C. Zentgraf
Think of the controllers/actions as pages on your website. If it makes sense to do everything on one page (i.e. in one action) than do that. Just because models and controllers of the same name are automatically linked doesn't mean you shouldn't or can't use other models as well. On 8 Oct 200

Re: How do you make line breaks appear in views?

2008-10-07 Thread David C. Zentgraf
http://jp2.php.net/nl2br Or use or CSS white-space: pre. On 8 Oct 2008, at 08:33, Cody Sortore wrote: > > Okay, I know I sound like a complete n00b right now, and that's fine > because I am. I've really only made applications for myself so far so > putting in tags is no problem... but now th

Re: $this->pageTitle not showing Japanese characters

2008-10-06 Thread David C. Zentgraf
On 6 Oct 2008, at 17:47, grigri wrote: > Make sure that your charset meta-tag is BEFORE the title tag. In an > older version of cake, the default layout had the reverse (title > first) which meant that it wasn't parsed as UTF-8. This shouldn't be the case. An HTML document is not evaluated by th

Re: $this->pageTitle not showing Japanese characters

2008-10-06 Thread David C. Zentgraf
On Oct 6, 4:00 pm, exo_duz <[EMAIL PROTECTED]> wrote: >> Hi David, >> >> All pages contain: >> >> charset('UTF-8'); ?> >> >> >> in the default layour (default.ctp). >> >> On Oct 6, 3:22 pm, "David C. Zentgraf" <

Re: $this->pageTitle not showing Japanese characters

2008-10-05 Thread David C. Zentgraf
That's simply an encoding problem. Is your .php file saved in UTF8? Are there UTF8 meta tags in the page header? Also see very recent discussion: http://groups.google.com/group/cake-php/msg/8f40e1bd40182e11?hl=en On 6 Oct 2008, at 15:15, exo_duz wrote: > > Hi all, > > Is there a different way t

Re: css parsing stripping background-image tags from css

2008-10-05 Thread David C. Zentgraf
Are you using CSS compression? If so, if the CSS syntax is invalid Cake might strip it out accidentally when removing comments etc. And the usual: Check caching. Maybe Cake or your webserver is just serving an old copy. Make sure you are looking at the same two files (editing A while actual

Re: $this->

2008-10-05 Thread David C. Zentgraf
The very basics in simple language: An object is grouping variables and functions together. class MyObject { var $myObjectVariable = 12; function myObjectFunction() { // does something } } You can move a bunch of functions and variables around in one pac

Re: dealing with curly quotes

2008-10-05 Thread David C. Zentgraf
class DATABASE_CONFIG { var $default = array( 'driver' => 'mysql', ... 'encoding' => 'utf8' ); } I forget to put that in on a regular basis and it always costs my a few minutes of debugging. ;-) Not sure why it's not in the default

Re: how to display a different field name from the database in the model

2008-10-04 Thread David C. Zentgraf
can do such that it will read the > 'name_en_gb' field in the product table in the database, but at the > code level, the view, controller, etc can access it using the 'name' > field. > > Thank you > > On Oct 5, 2:21 pm, "David C. Zentgraf" <[E

Re: how to display a different field name from the database in the model

2008-10-04 Thread David C. Zentgraf
If you mean "display to the user" I don't see where the problem is. If you're talking about scaffolding, just make a proper view. If you mean "change internally" it's more hassle than it's worth IMHO. Can you clarify a bit what you want to do and where you're stuck? On 5 Oct 2008, at 10:32, robe

Re: How to recode MySQL Boolean field to yes/no in a view

2008-10-03 Thread David C. Zentgraf
Over-engineer much? ;-) echo $model['boolField'] ? 'Yes' : 'No'; On 3 Oct 2008, at 17:08, Kanten wrote: > > Hi, > > I have a MySQL table with lots of boolean fields (BOOL) and when > viewing these in my view I would like to output "Yes" or "No" instead > of "1" or "0". > > I have experimented a

Re: AJAX: is it possible to update the src parameter of an image directly?

2008-10-02 Thread David C. Zentgraf
Sorry, try request.responseText. And put it in the Book if it worked. :-) On 3 Oct 2008, at 02:44, qwanta wrote: > > > > On Oct 1, 11:59 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> 'callback' doesn't exist, the only names of callbacks

Re: AJAX: is it possible to update the src parameter of an image directly?

2008-10-01 Thread David C. Zentgraf
lert("Loading")', > 'loaded'=> 'alert("Loaded")') > === > Loading, loaded & complete all fire the alert window OK. But I don't > get the callback one. Is there anything special to be set up? Thanks. > > > On Oct

Re: AJAX: is it possible to update the src parameter of an image directly?

2008-10-01 Thread David C. Zentgraf
I guess the AJAX helper doesn't have this ability built-in, but you could simply write your own JS for the 'complete' callback. http://book.cakephp.org/view/211/Callback-Options On 2 Oct 2008, at 12:12, qwanta wrote: > > Using pure php/javascript without cakephp, I am able to use the > javascr

Re: Best way to localize URL

2008-10-01 Thread David C. Zentgraf
You could use Routes to connect URLs to a controller by an alternate name: Router::connect('/マイアップ/外国語/何々', array('controller' => 'actualController', 'action' => ...)); But that can be become quite a hassle if you have many controllers and actions. Any variables in the URL you could store i

Re: 'schema generate' and different connections (was: help with YAML pls basic syntax...etc)

2008-10-01 Thread David C. Zentgraf
es on how to > reproduce it. > > -Mark > > On Sep 30, 1:53 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> Speaking of which... >> >> I have multiple connections in my database.conf. Running a 'cake >> schema generate' a

Re: 'Undefined index' problem on production server

2008-09-30 Thread David C. Zentgraf
fetched correctly... > > Thanks in advance, > Pieter Van Leuven > > On 30 sep, 07:37, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> Stabs into the dark: >> >> a) your local PHP has a lower debug level than your production >> server, >>

Re: 'schema generate' and different connections (was: help with YAML pls basic syntax...etc)

2008-09-29 Thread David C. Zentgraf
Speaking of which... I have multiple connections in my database.conf. Running a 'cake schema generate' always quits with "Error: Missing database table 'x' for model 'y'". Even doing 'schema -connection alt -name Model generate' quits with the same message. Depending on which '- connection

Re: 'Undefined index' problem on production server

2008-09-29 Thread David C. Zentgraf
Stabs into the dark: a) your local PHP has a lower debug level than your production server, i.e. your local system doesn't complain about missing indexes but your server does b) the associated model can't be fetched because your database setup is different/misconfigured Hope that helps, Da

Re: Does anyone know why naming your controller actions 'new' or 'list' causes an error?

2008-09-22 Thread David C. Zentgraf
It's not a Cake issue, it's a PHP thing. "new" is a reserved word for PHP and list() happens to be a language construct that looks like a function, hence it's out too. http://jp.php.net/manual/en/reserved.php http://jp.php.net/list On 22 Sep 2008, at 16:59, trustfundbaby wrote: > > I'm usin

Re: Generate List with SQL calculated Fields

2008-09-21 Thread David C. Zentgraf
Play around with the Set::combine() or Set::extract() methods to get the array into the right shape. http://api.cakephp.org/class_set.html#80506e373d04c93eb4dc1582d8e5c09c On 22 Sep 2008, at 06:26, ORCC wrote: > > Usually I create lists for using with $form->select(), vía > find('list') method

Re: correct syntax for an OR

2008-09-21 Thread David C. Zentgraf
http://book.cakephp.org/view/74/Complex-Find-Conditions On 22 Sep 2008, at 09:32, . wrote: > Hi > > How would I do an OR in the conditions, such as the following? > What's the > correct syntax? Thanks > > $messages = $this->Message->find('all', > array('conditions'=>array('Email.email'=>$ema

Re: How to count associated records in a model?

2008-09-21 Thread David C. Zentgraf
You can skip the App::import step completely. Your models are already associated, so $this->Product is already accessible. In fact, App::import doesn't do anything, it works like require_once(), you would still have to manually instantiate the imported model class yourself (i.e. App::impor

Re: HABTM find all

2008-09-20 Thread David C. Zentgraf
You can not search on conditions of a related model (generally, some tricking with bind() might do the trick). But, you can search for a group ($this->MyGroup->find()), which will automatically get you all the related Users as well. You can further filter these users with the Containable beh

  1   2   >