Re: How to find if findBy... is empty?

2010-07-20 Thread Jeremy Burns | Class Outfit
$jobstatus = $this-Jobstatus-findByTrackingno($this-data['Jobstatus']['track'])); if (empty($jobstatus): do something; else: do something else; endif; $this-set('jobstatus', $jobstatus); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 19

Re: cakephp email component

2010-07-20 Thread Jeremy Burns | Class Outfit
It is so hard to help you with questions like this when we don't know what's going wrong. Can you be more specific? Can you paste an error message? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 19 Jul 2010, at 08:12, fadhli - wrote: ?php class

Re: how to create forms

2010-07-20 Thread gabriel
Here a good tutorial for a contact form! http://snook.ca/archives/cakephp/contact_form_cakephp On Jul 19, 4:14 pm, amr_AJ ramruth...@gmail.com wrote: how to create forms Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

Re: Login using Auth component

2010-07-20 Thread designv...@gmail.com
Put the caching logic in the login action in your controller, and use the autoRedirect variable, as described here: http://book.cakephp.org/view/395/autoRedirect d. On Jul 19, 4:13 pm, Petter Andreas Strøm past...@gmail.com wrote: Hi, Im modifying an existing login function which uses the

Using same functions in several views

2010-07-20 Thread Petter Andreas Strøm
Hi, I'm trying to implement some functionality for hiding buttons(and info) from a page depending on parameters sat for the specific user (in the model). Off course to create some restrictions for the different users. But im kind of confused how to do this. The way i do it now is like: 1. Cache

Re: Using same functions in several views

2010-07-20 Thread Petter Andreas Strøm
Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to check if user have this capability like if(userHasCap('user_edit')). How can i make a function like this and include it into every view i need it? Component? Check out the new

HABTM - can't get model back

2010-07-20 Thread Andrew
Hi all, I am having a problem getting data from a model connected to a HABTM If I have two models, the first being hasMany to the second, then if I do a find on the second, I can normally access the first models fields, because a LEFT join is done? However, if the model is HasAndBelongsToMany

Re: Using same functions in several views

2010-07-20 Thread Zaky Katalan-Ezra
Inherit from Helper class and put it in /views/helpers. class LegendHelper extends Helper { var $helpers = Array(Html); function legendColor($arg1, $arg2) { terun true;} } in view use it $legend- legendColor(1, 5); Check out the new CakePHP Questions site

translate behavior: no join for default language?

2010-07-20 Thread M
for example, i have posts table and i18n table. posts table already have data in english so i created data of the other language in i18n. i was wondering if there's a way to retrieve data from posts table when language is english. or do i have to create english data in i18n table? Check out the

Re: alt tag for text box

2010-07-20 Thread grigri
Nope, not without using javascript. Tooltips are generated by the browser and can't be customised. There are some custom tooltip javascript solutions around, though - do a search and I'm sure you could find one. There's a mootools one here: http://davidwalsh.name/mootools-12-tooltips-customize

Re: Using same functions in several views

2010-07-20 Thread Mike Karthauser
hi Petter; On Tue, July 20, 2010 9:12 am, Petter Andreas Strøm wrote: Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to check if user have this capability like if(userHasCap('user_edit')). How can i make a function like this

checking posted data

2010-07-20 Thread rakeshyadav rakeshyadav
hi all, I am trying to execute query with some posted value the query is like this $sql = SELECT DISTINCT `csd`.`store_id` ,`csd`.`campaign_id`, `csd`.`date` , `c`.`campaign_id` ,`c`.`supplier_id` , `cm`.`sub_category_id` FROM `campaign_store_dates` AS `csd` LEFT JOIN

Problems with AppHelper

2010-07-20 Thread Galymzhan
Hi, group. I did a blog application in tutorial. I've 2 views like in tutorial: edit.ctp: h1Edit Post/h1 ?php echo $form-create('Post', array('action' = 'edit')); echo $form-input('title'); echo $form-input('body', array('rows' = '3')); echo $form-input('id',

Re: Provide read-only interface for our CMS (Drupal)

2010-07-20 Thread Galymzhan
Hi. If I understand you correctly you want to pull data from CakePHP app and show it in Drupal. So why don't you consider using REST or something similar (web services?). AFAIK cake supports REST. From the drupal side, you have to write a module to interact with RESTservices provided by your cake

Url in cake

2010-07-20 Thread nicky
hii i m developing a project in cake where i want some words to come before controllers name like as http://www.abc.com/teama/users http://www.abc.com/teamb/users Can it is possible i have nothing to do with this word team a and team b just for displaying . Can it be possible in cake please

Re: how to include new actions in ACL?

2010-07-20 Thread rez...@gmail.com
run build_Acl again On Jul 19, 12:40 pm, matsakaw igebas...@gmail.com wrote: i struggled with Acl/Auth and i admit i just followed the steps without FULLY understanding what i did -- to generate the aros, acos and aros_acos tables using the build_Acl and initDB functions mentioned in the cake

Site issues after moving host

2010-07-20 Thread AzzBrands
Hi All, I recently moved hosts for my site and now it doesn't function. I get the following errors. Notice: Undefined index: action in /home/baristaa/public_html/cake/ dispatcher.php on line 142 Notice: Undefined index: controller in /home/baristaa/public_html/cake/ dispatcher.php on line 149

How to add global variable

2010-07-20 Thread xiaopang
Hello: I am a newby to Cakephp, I have some simple data which I don't want to store in database but I want them to be application wide accessible. for view, controller as well as model. For example: I have a array $admin_type, which define 2 types of system administer,

Form helper: DIVs vs tables

2010-07-20 Thread Hugo M
Hi all! I have a question, I'm making forms using form helper. What's better, creating forms with tables or with divs? Divs are the only way to create forms with the cakePHP form helper, right? I'm not a css master :P, so maybe I don't understand very well why using divs instead of tables in

Re: Form helper: DIVs vs tables

2010-07-20 Thread Mike Karthauser
hi hugo On Tue, July 20, 2010 3:07 pm, Hugo M wrote: Hi all! I have a question, I'm making forms using form helper. What's better, creating forms with tables or with divs? Divs are the only way to create forms with the cakePHP form helper, right? I'm not a css master :P, so maybe I don't

Re: Form helper: DIVs vs tables

2010-07-20 Thread Hugo M
Yeah I agree! Tables are for tabular data. But that site uses tables :O, but maybe is not the best option. Thanks I will se what I can do 2010/7/20 Mike Karthauser mi...@brightstorm.co.uk hi hugo On Tue, July 20, 2010 3:07 pm, Hugo M wrote: Hi all! I have a question, I'm making forms using

Re: Form helper: DIVs vs tables

2010-07-20 Thread Mike Karthauser
hi hugo heres a form similar the remember the milk which doesnt use tables http://veerle-v2.duoh.com/blog/comments/styling_forms_in_css/ should give you some pointers. mikek On Tue, July 20, 2010 4:04 pm, Hugo M wrote: Yeah I agree! Tables are for tabular data. But that site uses tables :O,

Re: Provide read-only interface for our CMS (Drupal)

2010-07-20 Thread geste
Galymzhan, Thanks for a great, short answer to a long question. I am a perpetual newbie when it comes to some of this stuff and I had not looked at REST yet. I wasn't thinking of HTTP-type access because this app requires SSL+authentication, but I could probably set up a localhost- only Apache

Re: Using same functions in several views

2010-07-20 Thread Petter Andreas Strøm
Thanks people! Worked out great;) On Jul 20, 12:29 pm, Mike Karthauser mi...@brightstorm.co.uk wrote: hi Petter; On Tue, July 20, 2010 9:12 am, Petter Andreas Str m wrote: Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to

Re: Using same functions in several views

2010-07-20 Thread Petter Andreas Strøm
Thanks people! Worked out great;) On Jul 20, 12:29 pm, Mike Karthauser mi...@brightstorm.co.uk wrote: hi Petter; On Tue, July 20, 2010 9:12 am, Petter Andreas Str m wrote: Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to

Re: how to include new actions in ACL?

2010-07-20 Thread mattmoy...@gmail.com
matsakaw, there are a few scripts floating around the automagically update your acl tables. This has been working great for me with cakephp 1.3 http://bakery.cakephp.org/articles/view/automatically-load-all-controllers-and-actions-into-aco-tables-for-acl-with-a-cakephp-task You simply drop the

Re: How to add global variable

2010-07-20 Thread mattmoy...@gmail.com
The reason you can't do this easily is because it goes against Cake's conventions. Try learning to do things the cake way and it will make your life way easier in the long run. Especially if you will be building multiple cake applications in the future! What you should do is implement Acl to

Re: how to include new actions in ACL?

2010-07-20 Thread mattmoy...@gmail.com
As a follow up to my former post here is some code to assist you: /** * Rebuild the Acl based on the current controllers in the application * * @return void */ function buildAcl() { $log = array(); $aco = $this-Acl-Aco; $root = $aco-node('controllers'); if

Re: Site issues after moving host

2010-07-20 Thread mattmoy...@gmail.com
Well on a hunch, did you make sure you cleared your tmp and cache directories? In the past this has fixed most of these weird issues that pop up in migration for me. On Jul 20, 4:32 am, AzzBrands stellabra...@gmail.com wrote: Hi All, I recently moved hosts for my site and now it doesn't

Re: let users 'edit' database

2010-07-20 Thread mattmoy...@gmail.com
Drupal does something like this called revisions. You could implement a much simpler version of this in your application by adding 2 columns to your database called revision and display. Revision would just be a revision number and you could use a timestamp as the field so it would be unique and

Re: Using same functions in several views

2010-07-20 Thread mattmoy...@gmail.com
Your life would be soo much easier if you were using cake's ACL in your application. It handles all of the stuff you are trying to do automagically. It can be a little intimidating for new users but once you figure it out you will never use anything else again. Here is a great 2 part tutorial

Re: Url in cake

2010-07-20 Thread cricket
On Tue, Jul 20, 2010 at 2:18 AM, nicky kamal.d...@gmail.com wrote: hii i m developing a project in cake where i want some words to come before controllers name like as http://www.abc.com/teama/users    http://www.abc.com/teamb/users Can it is possible i have nothing to do with this word team

Re: How to add global variable

2010-07-20 Thread Dr. Loboto
If you need global variable, use Configure class designed specially for this. http://book.cakephp.org/view/43/Configure-Methods On Jul 20, 3:45 pm, xiaopang yve...@gmail.com wrote: Hello: I am a newby to Cakephp, I have some simple data which I don't want to store in database but I want

Re: Problems with AppHelper

2010-07-20 Thread Dr. Loboto
Try attach Session helper explicitly: class AppHelper extends Helper { public $helpers = array('Session'); } On Jul 20, 10:05 am, Galymzhan kozha...@gmail.com wrote: Hi, group. I did a blog application in tutorial. I've 2 views like in tutorial: edit.ctp: h1Edit Post/h1 ?php        

Re: HABTM - can't get model back

2010-07-20 Thread cricket
On Tue, Jul 20, 2010 at 4:33 AM, Andrew grievea...@yahoo.com wrote: Hi all, I am having a problem getting data from a model connected to a HABTM If I have two models, the first being hasMany to the second, then if I do a find on the second, I can normally access the first models fields,

Re: Form helper: DIVs vs tables

2010-07-20 Thread ohcibi
This example is emulating tables with divs which is the same as tables in the end... for this kind of layout, you have to give the labels the formhelper adds a fixed width which equals your left column On 20 Jul., 17:10, Mike Karthauser mi...@brightstorm.co.uk wrote: hi hugo heres a form

Re: checking posted data

2010-07-20 Thread cricket
On Tue, Jul 20, 2010 at 9:20 AM, rakeshyadav rakeshyadav rakeshyadav@gmail.com wrote: hi all,   I am trying to execute query with some posted value the query is like this  $sql = SELECT DISTINCT `csd`.`store_id` ,`csd`.`campaign_id`, `csd`.`date` , `c`.`campaign_id` ,   

Re: Problems with AppHelper

2010-07-20 Thread grigri
The problem here is that FormHelper does not load SessionHelper. Sub-helpers do not merge automatically (unlike controllers), you have to do it manually... like so class AppHelper extends Helper { var $helpers = array('Session'); function __construct() { if (is_subclass_of($this,

Ghosts in Auth component register action

2010-07-20 Thread Hugo M
Hi! I want to add token mail verification but I notice that php is not entering in register function when creating user (probably Auth component is registering users automagically). The thing is I need to put somewhere my code to send a mail to the users email account :S. I put a die() in

Re: Form helper: DIVs vs tables

2010-07-20 Thread Hugo M
Good advice, thanks ohcibi. I was using left and right float behaviors but not with fixed width. 2010/7/20 ohcibi i...@dwgadf.de This example is emulating tables with divs which is the same as tables in the end... for this kind of layout, you have to give the labels the formhelper adds a

Re: Ghosts in Auth component register action

2010-07-20 Thread Hugo M
Lol... I was using create() function and there's no automagic there. Facepalm xD 2010/7/20 Hugo M ham1...@gmail.com Hi! I want to add token mail verification but I notice that php is not entering in register function when creating user (probably Auth component is registering users

Re: Assign Profile When User Registers

2010-07-20 Thread Daniel M.K.
The Schema is simple, user has Username, Password, Email, and the Group ID that is default for users. Profile just has a user_id, but in this profile i want to check email, first name and last name when user registers and assign him his profile. Thanks! On 19 jul, 01:01, cricket

routing issue with languages language switch links

2010-07-20 Thread dr. Hannibal Lecter
Hi everyone, I've asked this a few times on IRC, but I guess it's too complicated(?) to be answered over IRC. I'm trying to build a multilingual web site, so I've created the following route: Router::connect('/:language/:controller/:action/*', array(), array('language' = '[a-z]{3}')); Now,

how can i realize this in cake? clicking on a DIV field opens a popup

2010-07-20 Thread Tomfox Wiranata
hi. i'll try to make it quick :) here is what i wanna do: a user has the opportunity to place information about him on my website. for that i wanna provide a template. and this i want the user being able to to. he has an empty page in front of him, divided by areas, that need to be filled with

Email Component

2010-07-20 Thread Ed Propsner
I recently changed names on one of my sites and moved the entire site to a different dir on the server. Everything went smooth enough except now I'm unable to send emails. Mail sends ok using PHP mail() function but not when using the email component. The email is NOT set up for SMTP. Am I

Unicode problem between controller and view

2010-07-20 Thread Kirk
I thought someone here may have some experience with this. I fetch utf-8 data from a mysql db using: $this-data = find('all',$options); From within the controller, if I debug($this-data), I get something like: [1] = Array ( [Subdivision] = Array (

Re: How to add global variable

2010-07-20 Thread euromark
if you actually need to save the keys in some models like users (id, name, admin_type, ...) you could take a look at http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ thats how I do it - application wide available and easy to extend (if you ever need more types etc)

Re: Using same functions in several views

2010-07-20 Thread euromark
careful with foreach(Cache::read('userCapList') as $userCap)... !!! Cache::read() is not in all cases a array to iterate over sometimes its false etc so make sure to cast it to an array: foreach((array)Cache::read('userCapList') as $userCap)... or do it in 2 steps On 20 Jul., 16:48,

Re: Unicode problem between controller and view

2010-07-20 Thread Kirk
As an extra piece of information, if I specify the escape option as 'ISO-8859-1' in the link method of the html helper ( http://book.cakephp.org/view/1442/link), the non-ascii characters are substituted for html entities, and it renders fine (without the little question marks). (I am using

Phrase inflections

2010-07-20 Thread desheffer
I have a model called LeaveOfAbsence. The proper English name for the pluralized controller would be LeavesOfAbsence rather than LeaveOfAbsences (similar to the plural mothers-in-law). Does anyone know to set up inflections for this specific case? It seems that CakePHP only looks at the last word

Re: Unicode problem between controller and view

2010-07-20 Thread Kirk
And the plot thickens... If I change the character encoding in core.php to: Configure::write('App.encoding', 'ISO-8859-1'); Then suddenly the text shows up correctly. Which means that even though I'm specifying UTF-8 as the character encoding, cake is still using ISO-8859-1 (or Windows-1252?)

Re: HABTM - can't get model back

2010-07-20 Thread Andrew
Thanks, I'll give it a go Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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

Re: Unicode problem between controller and view

2010-07-20 Thread Kirk
i found the solution here: http://www.jotlab.com/2009/03/03/cakephp-utf-8/ all you have to do is add 'encoding' = 'UTF8' to database.php doh! On Tue, Jul 20, 2010 at 6:59 PM, Kirk k...@kirkkahn.com wrote: And the plot thickens... If I change the character encoding in core.php to:

HELP: cron_dispatcher 1.3.2 import plugin models

2010-07-20 Thread trav
Hi, I can't seem to import a plugin model when running controller from the cron_dispatcher. Here is a simple test result. ver: 1.3.2 cron_dispatcher: http://tricks.cakephp.in.th/comland-line-and-cronjob 1. running from web . [WORKS] 2. running testA function WITHOUT model import from

cake_1.2.3.8166 and AdminAuth

2010-07-20 Thread simon...@terra.com.br
Good Night, I'm trying to make the AdminAuth component work on cake_1.2.3.8166. I did uncomment Configure::write('Routing.admin', 'admin'); on line 67 of the file app/config/core.php. On the file app/app_controller.php lines 49-50 I have this code:

Re: Unicode problem between controller and view

2010-07-20 Thread MattyHead
Thank you for posting your whole experience with this! And congratulations for figuring it out so quickly. Cheers, Matt On Tue, Jul 20, 2010 at 7:15 PM, Kirk k...@kirkkahn.com wrote: i found the solution here: http://www.jotlab.com/2009/03/03/cakephp-utf-8/ all you have to do is add

Re: Phrase inflections

2010-07-20 Thread MattyHead
I know you can fake it with Routes, but I fear you'd end up tweaking URLs in your views like crazy. http://book.cakephp.org/view/46/Routes-Configuration Sorry, I have nothing better. Matt On Tue, Jul 20, 2010 at 1:36 PM, desheffer deshef...@gmail.com wrote: I have a model called

Re: how can i realize this in cake? clicking on a DIV field opens a popup

2010-07-20 Thread cricket
On Tue, Jul 20, 2010 at 4:46 PM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi. i'll try to make it quick :) here is what i wanna do: a user has the opportunity to place information about him on my website. for that i wanna provide a template. and this i want the user being able to

Re: Email Component

2010-07-20 Thread Hugo M
Strange, do you have any configuration related with Email component? if I can send mail with mail() I can send with the component :S 2010/7/20 Ed Propsner crotchf...@gmail.com I recently changed names on one of my sites and moved the entire site to a different dir on the server. Everything

Re: Email Component

2010-07-20 Thread Ed Propsner
Nope, nothing. I originally used it right out of the box and I didn't have to change a thing. It was working perfectly until I changed to a new dir on my server. It really makes no sense. On Tue, Jul 20, 2010 at 8:49 PM, Hugo M ham1...@gmail.com wrote: Strange, do you have any configuration

Re: Email Component

2010-07-20 Thread Hugo M
Mm... if you have Linux you can check in /etc/php5/apache2/php.ini the sendmail configuration and the sendmail path. Maybe is put as a relative path (I don't see a good reason to do that but... who knows :P) 2010/7/20 Ed Propsner crotchf...@gmail.com Nope, nothing. I originally used it right

Re: Unicode problem between controller and view

2010-07-20 Thread Kirk
I thought it might get annoying... my conversation with myself. But I hope it helps someone! On Tue, Jul 20, 2010 at 7:47 PM, MattyHead mattyh...@gmail.com wrote: Thank you for posting your whole experience with this! And congratulations for figuring it out so quickly. Cheers, Matt On

Re: checking posted data

2010-07-20 Thread rakeshyadav rakeshyadav
On Tue, Jul 20, 2010 at 9:48 PM, cricket zijn.digi...@gmail.com wrote: On Tue, Jul 20, 2010 at 9:20 AM, rakeshyadav rakeshyadav rakeshyadav@gmail.com wrote: hi all, I am trying to execute query with some posted value the query is like this $sql = SELECT DISTINCT

CakePHP 1.3.2 Pagination Error under Plugin

2010-07-20 Thread Bryan de Asis
I'm having errors when trying to execute Pagination I'm not having this kind of problem on version 1.2.x: Warning (4096): Object of class JsHelper could not be converted to string [CORE/cake/libs/view/helpers/javascript.php, line 259] Notice (8): Object of class JsHelper to string conversion