Best practice for Auth / ACL / editing your own content

2011-07-20 Thread Shaz
At the moment I use Auth Component for users to login / logout - ACL is defined to sort between user groups (Guests, Users, Admins) - with obvious restrictions - Admin being able to access everything, the user can only access edit in the users controller and the guest being able to see just the

Setting a minMonth / minDay like minYear and maxYear?

2011-07-13 Thread Shaz
http://book.cakephp.org/view/1390/Automagic-Form-Elements ^^ It's possible for me to make sure a user doesn't choose beyond a minimum and maximum years, but whats the best way of putting limits on the months and days as well? Basically I want to make sure a user can only select a date in the

Only allow a single session per user account?

2011-06-24 Thread Shaz
Just wanted to ask what would be the best way of doing this? Essentially if a person logs in from one location, and then a while later from the other - I want them to immediately be logged out from the first location. -- Our newest site for the community: CakePHP Video Tutorials

Re: Validating HABTM

2011-06-15 Thread Shaz
I haven't actually made models for the Join table - I don't think you need to for a HABTM relationship On Jun 15, 1:41 pm, Rob Maurer robmau...@gmail.com wrote: Interesting. What would happen if you put the validation in the model for the join table? On Jun 14, 3:17 pm, Shaz shazam

Re: POST from external site

2011-06-15 Thread Shaz
Double check the URL you're sending the POST request to - and ensure the controller action is setup to receive it; especially if you're using Auth / ACL. Also post date in cake should be available in $this-params. On Jun 14, 3:53 pm, Ivan Rocha ivan.cr.n...@gmail.com wrote: Hi, I'm trying to

Re: How to inactive Acl

2011-06-15 Thread Shaz
http://book.cakephp.org/view/1545/Preparing-to-Add-Auth At the bottom it explains how to allow actions currently not initialised as ACO's. On Jun 13, 7:21 pm, taq taqman...@gmail.com wrote: now I use acl component in my webapp when I add new action I got you unauthorize to access this location

Re: find list

2011-06-15 Thread Shaz
Try the threaded find? But list with fields specified correctly should do the job. Read the documentation carefully: http://book.cakephp.org/view/1022/find-list On Jun 11, 3:33 am, cake-learner sh.koiz...@gmail.com wrote: Can I get the search result so that it returns the id as key? so if you

Re: I am using jQuery in my form BUT it relies on ProtoType to work???

2011-06-15 Thread Shaz
Use pure javascript vs the JS helper for jQuery - should sort it. On Jun 9, 8:48 am, OldWest ja...@jasonwydro.com wrote: I could be missing something severely here, but this is just not adding up. I built an ajax form which is working perfectly fine with ProtoType and Scriptaculous. I am

Validating HABTM

2011-06-14 Thread Shaz
I have User HABTM Language, and i want to ensure during a User add / edit they choose a minimum of one language, upto a maximum of 3. In the user model, for $validate I've tried: 'Language' = array( 'multiple' = array( 'rule' =

Re: Validating HABTM

2011-06-14 Thread Shaz
that validation; where I only want the users to... Thanks! On Jun 14, 8:14 pm, hunny saurabh85maha...@gmail.com wrote: Write the Validation Rule in Language Model instead of User Model On Jun 14, 9:56 pm, Shaz shazam...@gmail.com wrote: I have User HABTM Language, and i want to ensure during

URL Params - Adding more value's for a key?

2011-06-05 Thread Shaz
I know this is possible: site.com/controller/action/key1:value/key2:value etc Is there a way to add more than value to a key? For example: site.com/controller/action/key1:value1|value2|value3/key2:val1|val2/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org

Re: URL Params - Adding more value's for a key?

2011-06-05 Thread Shaz
(base64_decode($this-params['named']['yourkey'])); -- Lep pozdrav, Tilen Majerlehttp://majerle.eu 2011/6/5 Shaz shazam...@gmail.com I know this is possible: site.com/controller/action/key1:value/key2:value etc Is there a way to add more than value to a key? For example: site.com

Re: Caching

2011-05-31 Thread Shaz
Use sessions to store your navigation data / parameters and call the appropriate method? On May 31, 1:44 pm, Jeremy Burns jeremybu...@classoutfit.com wrote: I've raised a similar question before but got no responses, so I'll try something more specific. I have an application that is pretty

HABTM Pagination

2011-05-30 Thread Shaz
I have the following relationships (habtm both ways): User HABTM Groups User HABTM Events User HABTM Locations So for example - I want to get users that belong to groupA, groupB and locationX and paginate the results - whats the best way of implementing it? I'm trying to avoid using

Re: Find with $hasAndBelongsToMany

2011-05-30 Thread Shaz
I've just posted a similiar query! Googling around has given me the bindModel() method - which you can read at the bottom of the page here: http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM But I wasn't able to get it to work for me. There's also a method using manual joins and

Re: Saving ARO taking around 10 seconds, processing tree behavior.

2011-05-30 Thread Shaz
Index it! http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component On May 30, 7:29 pm, Tufla hocanaste...@gmail.com wrote: After apply the change, the reading process has been improved a little, but the writing process continue taking a lot time :S BTW I checked and the AROS

Re: One-way relationship

2011-05-30 Thread Shaz
You need the relationship both ways: Item hasOne Unit Unit belongsTo Item Add a few items and units into the database. Then go back to the item controller, edit action and make sure you get a list of all the units: $this-Item-Unit-find('list')); Hopefully that helps. On May 29, 11:53 pm,

Re: Form helper input select box customization

2011-05-30 Thread Shaz
Should be able to find what you're looking for at: http://book.cakephp.org/view/1390/Automagic-Form-Elements On May 29, 1:08 pm, Jae Choi hybm...@hotmail.com wrote: Hi all, Is there a way we can show multiple columns to select when selecting belongsto values in edit.ctp view rather than just

Re: Error: Database table acos for model Aco was not found.

2011-05-30 Thread Shaz
Was it an sql dump or just the schema? It might be a case of rebuilding the ACL... On May 27, 5:11 am, 8vius lmd...@gmail.com wrote: Hey all, I'm new to CakePHP and I'm using it at work. I have a Mac running Mac OS X Leopard at work as well as at home and a PC at work as well. I have the

Re: Use a mysql read-replica in a high traffic site?

2011-05-09 Thread Shaz
/Replication-load-balancing-suppo... On May 6, 3:18 pm, Shaz shazam...@gmail.com wrote: Just wanted to ask if anyone knows how best to do this - essentially I want to be able to send all the cakephp mysql selects (read) to a read- replica database and all the inserts/deletes/updates (writes

Use a mysql read-replica in a high traffic site?

2011-05-06 Thread Shaz
Just wanted to ask if anyone knows how best to do this - essentially I want to be able to send all the cakephp mysql selects (read) to a read- replica database and all the inserts/deletes/updates (writes) to the master database. For a bit of background - I've been tasked to build a site that will

Re: searching recursively doesnt work

2011-03-21 Thread Shaz
Can you put up your $this-find() statements and the results you get with them? I would've thought (in the Agreement Model) you could do something along the lines of this-Definition-Article find(all) conditions(article.field = '%string%') contain( user, agreement, definition) groupBy(definitions).

Re: Small help required...

2011-03-21 Thread Shaz
http://book.cakephp.org/view/1414/checkbox http://book.cakephp.org/view/1031/Saving-Your-Data ^^ Have a quick read - it's explained there. On Mar 21, 10:45 am, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Group, I am stuck in one situation and i don't know how to come out

Advanced Install Upgrading to 1.3.8

2011-03-20 Thread Shaz
Hi all, I've followed the instructions at http://book.cakephp.org/view/915/Advanced-Installation and essentially done the following on my Mac: 0 - Enabled mod_rewrite in my httpd.conf 1 - Forked CakePHP from git (cakephp/cakephp) into /usr/local/cakephp 2 - Setup Aliases for the cake console

Core Test Groups (All tests) Error

2011-03-20 Thread Shaz
I get the following when I try and run 'All Tests': Fatal error: Cannot redeclare class Article in /usr/local/cakephp/cake/ tests/cases/libs/model/models.php on line 283 I've setup cake slightly different (don't know if that's a factor - but you can see how i've done it here:

Re: needed opinion from experienced cakephp user

2011-03-20 Thread Shaz
http://www.notgoingtouni.co.uk - on it's launch it took traffic more than what you describe and cakephp didn't crumble one bit. Just make sure your hosting is up to scratch and be really good friends with a sys admin! On Mar 20, 11:39 pm, cricket zijn.digi...@gmail.com wrote: On Sun, Mar 20,

Re: image layout cant be seen after installation

2011-03-10 Thread Shaz
http://book.cakephp.org/#!/view/917/Apache-and-mod_rewrite-and-htaccess On Mar 10, 2:24 pm, rethab rethab...@gmail.com wrote: Does look like mod_rewrite was not activated. Did you check the activated modules on your server? On 10 Mrz., 06:41, cake_beginner honeynativi...@gmail.com wrote: i

Re: How to validate multiple fields with the same name?

2011-03-10 Thread Shaz
Sounds like a challenge! The only way I can think of is to write a custom validation rule that checks each of the submitted Product Names - have a read at: http://book.cakephp.org/#!/view/1179/Custom-Validation-Rules Let us know how you get one! Might be handy in the future... On Mar 9, 2:30 

Re: HABTM: has a related data

2011-03-10 Thread Shaz
Have you tried $this-Lot-paginate() ? Just seems like you're skipping the relationship if you're trying to paginate 'Lot' in 'Watches'? On Mar 7, 11:44 am, Angelo angelo.maior...@gmail.com wrote: Hello, I have a big problem, i've got the following structure: var $hasAndBelongsToMany = array(

Re: HABTM: has a related data

2011-03-10 Thread Shaz
Have you tried $this-Lot-paginate() ? Just seems like you're skipping the relationship if you're trying to paginate 'Lot' in 'Watches'? On Mar 7, 11:44 am, Angelo angelo.maior...@gmail.com wrote: Hello, I have a big problem, i've got the following structure: var $hasAndBelongsToMany = array(

TDD Curiosity

2011-03-10 Thread Shaz
Just a random thought - I've been helping a friend get to grips with cake and I know later on he *needs* to be introduced to test-driven development;; wouldn't it be more interesting it to teach the methodologies the other way around? For example, the first thing he would ever write would be a

Re: Editor for Comments

2011-03-10 Thread Shaz
http://ckeditor.com/ - I have a minimalist version of it working on a few of my cakePHP websites. On Mar 10, 2:22 pm, rethab rethab...@gmail.com wrote: You might want to use this PHP function:http://ch.php.net/manual/de/function.nl2br.php As for WYSIWYG Editors: I thought TinyMCE could be

Re: Site Development from Start to Finish

2010-11-12 Thread Shaz
It's better practice to use model relationships rather than $uses. i.e. $this-User-Drug-find(); On Nov 12, 4:30 pm, naidim nai...@gmail.com wrote: For the homepage controller, if User and Drug are not related but you want to use those models, you have to include them both. Maybe I should

Re: Paginator-sort() on associated model field

2010-11-10 Thread Shaz
Are you using any containable behavior? Or is the data being passed along correctly when using $this-Paginate() - the main error that jumps out me is: Argument #2 is not an array. On Nov 9, 6:43 pm, J. Argyl Plath jeremy.pl...@homefront.tv wrote: My User model belongsTo Department. When looking

Re: Is there a better web interface for SimpleTest?

2010-11-10 Thread Shaz
I've only just gotten started with TDD - don't think many folks on here use the tests, but I do know exactly what you mean. I haven't come across anything better - it might be a case of having to improve it ourselves... On Nov 9, 1:16 pm, psybear83 psybea...@gmail.com wrote: Hi all CakePHP's

Re: Paginated Model Question

2010-11-10 Thread Shaz
Basically whats easier for you - can't think of any standards for pagination. Keep in mind that you may want to expand on it later on (add more conditions, fetch more data etc) so keep it flexible. On Nov 7, 5:12 pm, Dave Maharaj m...@davemaharaj.com wrote: Not sure if I have been looking at

Build an API?

2010-11-10 Thread Shaz
Just wanted some idea's on how you would build an API for your application in Cake? An example of what I'm trying to achieve: Team A logs on - adds their players, what they scored and how on their site. Team B logs on and does the same. Both sites connect to each other and show the relevant

Re: Pass true or false as condition

2010-09-08 Thread Shaz
Also if I remember correctly cakephp doesn't read bolean from a database? http://nuts-and-bolts-of-cakephp.com/2008/10/06/cakephp-mysql-tinyint1-confusion/ On Sep 7, 10:11 pm, Miles J mileswjohn...@gmail.com wrote: Couldn't you just pass 1 and 0? Also your argument is backwards. True should

Re: Cakephp and Facebook Help

2010-09-08 Thread Shaz
Steer clear of facebooks widgets and take the time out to learn their new protocol. It took me about 4 hours to get the swing of it, and by the end of the day I had properly integrated facebook into a website (pulling data, publishing information and so forth).

Re: HELP! Design Review Risk Management topics required

2010-09-08 Thread Shaz
Google around - there's quite a few. Best bet would also be to search Google Scholar / ebooks, or pop down to your local library. On Sep 7, 8:35 am, Kalyana Yogam kalyanayogam.webm...@gmail.com wrote: Hi, I have to take 2 one hour sessions on the following topics: * Project Design Review *

Re: cake flashing 2 different flash messages.

2010-09-08 Thread Shaz
Can you put up your code? ... crud really shouldn't be defined in app_controller - rather in the app/user_controller, it might be a headache lateron On Sep 6, 7:37 am, Ernesto e.fanz...@gmail.com wrote: Hello. i have a problem that can't resolve. my app_controller::beforeFilter has a simple

Multiple Forms in the same controller / model to be validated differently?

2010-09-08 Thread Shaz
Here's an old article that shows how to do exactly what I want - but doesn't quite work: http://bakery.cakephp.org/articles/view/multiple-forms-per-page-for-the-same-model Any other way of using CakePHPs form validation on different forms? I have an add, edit function/view/form for my controller

Re: CakePhp Wordpress Integration

2010-07-27 Thread Shaz
You would be better off building the blog yourself using cake rather than integrating wordpress :) On Jul 27, 2:58 pm, euromark dereurom...@googlemail.com wrote: i once stumpled upon this:http://bitbucket.org/pixelastic/caracole-bbpress/src/a87149cbba0e maybe something similar could be

Re: Problem with Login Redirect

2010-07-27 Thread Shaz
Where does loginRedirect redirect you at the moment? Or no redirects at all? On Jul 27, 6:16 am, sebas46825 sebas46...@gmail.com wrote: hello, i have a problem with the login redirect i dont no why but when i write the loginRedirect it not redirect me, just show me the login page and i want to

Re: Login Redirect

2010-07-27 Thread Shaz
Read the 1.2 to 1.3 migrating guide - a few things have changed here and there, enough to cause a few headaches but easily updated. On Jul 27, 12:10 am, Dave Maharaj m...@davemaharaj.com wrote: I am upgrading from 1.2 to 1.3 and when I try to login I get redirecting forever message. I never

Re: Problems with controller not found

2010-07-27 Thread Shaz
Create the DB table and use cakebake. On Jul 26, 10:44 pm, Anderson Valongueiro anderson.valongue...@gmail.com wrote: Hi, guys! I have a problem. I never before use the pages_controller, because never need this. But today i needed create the pages_controller, by first time, and create the

Re: Interfacing with Android app (and/or iPhone)

2010-07-27 Thread Shaz
* I expect to exchange data via JSON (services already in place for some JS and Flex features) but as the request is not coming from a browser, how do I get info about the user / phone? Some info are contained in the HTTP request? How do I parse them? * Authentication: which the best (and

$this-paginate() inside a Model?

2010-07-14 Thread Shaz
With my current craze of moving all logic from my models to my controllers, a slight problem has risen - namely I can't seem to use $this-paginate() in a Model function thats called in a controller. $this-find() works perfectly find, and I'm trying to replace $this- find( 'all', $conditions );

Re: updating views in ajax

2010-07-14 Thread Shaz
Read up on call backs and the cake's ajax afterRender or beforeRender/load - it'll give you a better understanding on how best to you use AJAX. On 14 July, 08:37, engine radicalet...@gmail.com wrote: Hi friends, i dont know this questions has been asked before or maybe straight forward. But i

Re: $this-paginate() inside a Model?

2010-07-14 Thread Shaz
(Sorry I meant from my Controllers to my Models!) On 14 July, 12:12, Shaz shazam...@gmail.com wrote: With my current craze of moving all logic from my models to my controllers, a slight problem has risen - namely I can't seem to use $this-paginate() in a Model function thats called

Re: saveAll changing $this-data

2010-07-13 Thread Shaz
Oo interesting - it's removed 5 from 'asked' ad added it onto saving and confusion. Post up the $this-save() code so we can see whats going on. On 13 July, 12:01, tersmitten mischa.ter.smit...@gmail.com wrote: I'm trying to save my $this-data which is (already) a correct array. But when I do

Re: Another model displayField

2010-07-12 Thread Shaz
class Model extends AppModel { var $name = 'Model'; var $displayField = 'name'; } Change 'name' to whatever you want to be shown (i.e. 'title' etc) On 10 July, 20:58, Samueljslg samuelj...@hotmail.com wrote: Hello friends, I am starting with cakephp, I have a problem, you want

Re: filtering

2010-07-08 Thread Shaz
What sort of filtering and for what are you after? On Jul 8, 10:08 am, james jamesliv...@googlemail.com wrote: Hi I am also looking for some advice on filtering. Are these the best tutorials? thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their

Re: can't retrieve data from a form

2010-07-08 Thread Shaz
The form needs to be created with a name and then it also needs to end: $form-create('FormName'); $form-input( ... etc etc ); $form-end('Submit'); And you should be able to access your form data via $this- data['FormName'][ inputfield ]. On Jul 8, 1:31 pm, Tomfox Wiranata

Re: can't update data that is entered in form

2010-07-08 Thread Shaz
Also do a Cake Bake on a model to see how cake itself does pretty basic Create/Read/Update/Delete. On Jul 8, 10:17 am, Jon Bennett jmbenn...@gmail.com wrote: now if i hit the save button i get the error: UsersController::__updateProfile() cannot be accessed directly whats wrong here?

Re: Add to model conditions

2010-07-08 Thread Shaz
Use ternary php operators to check what the user selects, put them into a variable and attach that into the conditions; $condition = isset($this-data['Search']['Stars']) ? array('Offer.flag_stars' = $this-data['Search']['stars']) : ''; $results = $this-Offer-find('all', array(

Re: Cannot get this find() to work :(

2010-07-08 Thread Shaz
http://book.cakephp.org/view/74/Complex-Find-Conditions On Jul 8, 8:21 am, Ernesto e.fanz...@gmail.com wrote: Hello. i have this situation: Order hasMany Insertions hasOne Article i'm working in OrdersController i want lo load all Articles with at least one Insertion in a specific Order.

Re: Can Cake do this?

2010-07-08 Thread Shaz
Easily doable in CakePHP - it may take you a week or two to get around to Cake's way of doing things but stick with it. On Jul 7, 2:47 am, maxarbos maxar...@yahoo.com wrote: I am just getting into learning about cake and wanted to know if I am going to be able to do the things I am hoping it

Re: Controller action calling another model, how to override ACLS?

2010-07-08 Thread Shaz
Not that I can think of - but it is a controller that should be collecting data from models and passing them onto a view - not the view trying to access a different controller/model. And you can call other models for data from within a model/controller, provided the recursive relationships are set

Re: consulting associations, post comments users commentaries

2010-07-08 Thread Shaz
User hasMany Post User hasMany Comment Post hasMany Comment Post belongsTo User Comment belongsTo Post Comment belongsTo User On Jul 6, 4:43 pm, Vinicius Núñez viniciusnu...@gmail.com wrote: How are you? Which way can I show a post, its comments, and users that commented them? Do you know I'm

Re: Tree Reorder: What Does it Do?

2010-07-08 Thread Shaz
Nope sorry - I haven't any points during which I'd need to reorder a tree, and I'm struggling to think of where I'd need do it. On Jul 8, 1:02 pm, DragonFlyEye dragonflyey...@gmail.com wrote: Bump. Does anyone out there have any experience with this? On Jul 7, 9:04 am, DragonFlyEye

Re: Evolution of mini-controllers - thoughts??

2010-07-08 Thread Shaz
From my understanding - elements are just there as an option to show common views - such as a site with a top-level navigation bar that's the same throughout a website. I'm not sure why you would wish to extend or make us of them as much as you explained above - and using your analogy of trying to

Re: fatal error in create()

2010-07-06 Thread Shaz
Try $this-aro-create() instead. On Jul 6, 1:12 pm, Kanwal enggkanwalj...@gmail.com wrote: i have one controller in which i have following function: var $components = array('Acl'); function anyaction() {         $aro = $this-Acl-Aro;         //Here's all of our group info in an array we

Re: Cakephp ACL Permission

2010-07-06 Thread Shaz
You need to either manually add the ACO to the database or run the build_acl() function provided in the tutorial. On Jul 6, 11:03 am, malu star malustar2...@gmail.com wrote: I have add a function named 'add'  in one of my controlller and then i called that action that time i got this Notice

Re: Something like ActiveMerchant?

2010-07-06 Thread Shaz
Interesting - I have come across ActiveMerchant when doing RoR applications - but never thought about something similar mostly because the API support of most payment gateways is pretty straightforward using php... On Jul 5, 11:51 pm, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Has

Re: Inheritance of custom class

2010-07-06 Thread Shaz
CakePHP follows the MVC pattern. Each controller has an associated model and a view - you can specify in the model which database table to use, or to not use one at all - but unless you specify, you will keep getting errors. On Jul 5, 3:57 pm, vaugh...@switchdesign.com vaugh...@switchdesign.com

Re: How to use sql 'between' command with CakePhp requestAction()

2010-07-06 Thread Shaz
requestAction() is bad! Implement recursive relationship between models and use the find() with contain and conditions! On Jul 5, 2:38 pm, Ahmet Kemal ahmetkemala...@gmail.com wrote: Hello, I have an element that grabs data from mysql. Here is my working code:    

Re: am i doing it right? for this question AND overall...

2010-07-06 Thread Shaz
Not quite what CakePHP would like you to do - have a read of the tutorial for a simple ACL application. http://book.cakephp.org/view/641/Simple-Acl-controlled-Application On Jul 5, 5:13 am, randy ran...@gmail.com wrote: it feels kind of yucky... in order to get my auth+acl setup working, i

Re: Need CSV import: best practices?

2010-06-30 Thread Shaz
CakePHP follows the MVC design pattern - most of the heavy lifting should be done in the model with the controller just being the intermediary between the model and view. Remember: Fat Model, Skinny Controller http://teknoid.wordpress.com/2009/01/06/another-way-to-think-about-mvc/ On Jun 30,

Re: Session data not being displayed

2010-06-30 Thread Shaz
Very strange - can you put up the code from a controller where the session does work? I'm assuming they're identical - or they should be. Also it might be a case of overkill by using both: App::import('Core', 'l10n', 'Sanitize', 'CakeSession'); And: public $components =

Re: CakeFest 2010, who is going?

2010-06-30 Thread Shaz
I'd come if it wasn't so far away from London! On Jun 30, 3:38 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: Just want to start a thread and see how many people on the google group would like to attend or are planning to attend CakeFest 2010? This is the largest gathering of CakePHP

Re: CakeFest 2010, who is going?

2010-06-30 Thread Shaz
It's the fear of the airfare that's more dominant! Fingers crossed my little start-up will kick off, and be able to come to the next one :) On Jun 30, 3:45 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: Shaz, Are you afraid to fly? :) -- /** * @author Larry E. Masters * @var

Re: Functions in View could not able to load Helpers?

2010-06-30 Thread Shaz
.$html-link[$catName, You're using a square bracket? Should be: .$html-link($catName, On Jun 30, 5:13 pm, saidbakr said@gmail.com wrote: Hi, I have a little function in one of my views. This function could not able to use helpers. For example: //add.ctp // some html ?php function

Re: image and a tag problem without mod_rewrite

2010-06-30 Thread Shaz
You'll have to use $_SERVER[] to get your path: http://php.net/manual/en/reserved.variables.server.php On Jun 30, 2:45 pm, kaushik kaushikwo...@gmail.com wrote: I have developed my site in a server where mod_rewrite and .httaccess are available. I used '$this-webroot' variable for a tag and

Re: Auth 1.3.0 Auth-loginAction

2010-06-30 Thread Shaz
Are you following: http://book.cakephp.org/view/172/Authentication ? On Jun 30, 11:27 am, brianclark...@btconnect.com brianclark...@btconnect.com wrote: Hi I have configured the Auth component and its working fine. I need to save a User associated model in the session. I assume the best

Re: Is Beginning CakePhp from novice to professional still valid with CakePhp version 1.3.2?

2010-06-29 Thread Shaz
Used the book myself on CakePHP 1.3.2 - had no problems. On Jun 29, 7:10 am, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: There are more differences than that, but if you read the migration guide (http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3) you'll

Re: Which is the best hosting server for CakePHP?

2010-06-29 Thread Shaz
It's actually pretty cheap now to get your own VPS, and set it up exactly how you want to. I can recommend both HostingZoom + 11, faultless service over a number of years for an excellent price. On Jun 29, 5:59 pm, nurvzy nur...@gmail.com wrote: I'm a fan ofhttp://www.downtownhost.com. On Jun

Re: Can I read a session variable inside the model?

2010-06-29 Thread Shaz
There's been a lot of discussion about this - use the search box on the top right. I personally tend pass the session details as an argument through the controller: --- Model --- function whatEver ($session) { manipulate $session['User']; return something; } --- Controller --- function

Re: Need some help

2010-06-29 Thread Shaz
Can you be a bit more detailed on what you are trying to achieve? Outputting html in php is a simply matter of using echo 'html / html'; On Jun 29, 7:25 am, sunny ravite...@gmail.com wrote: Can anyone tell me how to add an html file to php script. Check out the new CakePHP Questions site

Re: Cookies from CAKE and other branding

2010-06-29 Thread Shaz
... adding to the above, what's wrong with a little bit of CakePHP branding? Most clients I've had don't particularly care about the code as long as it works, let alone know what a framework is On Jun 29, 1:59 pm, AD7six andydawso...@gmail.com wrote: On Jun 29, 5:01 am, Vangel

Re: find output array!

2010-06-29 Thread Shaz
Try find('list', array(contain = array( 'Model1', 'Model2' ))); On Jun 29, 1:23 am, saidbakr said@gmail.com wrote: Hi, From documentation, find may output array like the following: Array (     [0] = Array         (             [ModelName] = Array                 (                    

Re: Auth, login, own validation of password

2010-06-29 Thread Shaz
Make a new action in the controller, call it customLogin or whatever you want, and in there call the function in the model (below), which would return true/false, and if(true){ do this } else { do this } For the model: Make a new function to be called in the controller, use $this-

Re: Auth::authorize - controller -- How to handle guests?

2010-06-29 Thread Shaz
You can add $this-Auth-allowedActions = array('action'); to the app_controller.php for all controllers rather than having to set it for every single controller. Can't think of anything else other than that. On Jun 24, 2:52 pm, Melanie Sommer melanie-som...@mailinator.com wrote: Hello, I am

Re: I want to create messaging system like facebook

2010-06-22 Thread Shaz
Do you already have a schema going for different users? Then it's just a matter of creating a new table with id, user_id, recipient_id, title, and message; cake bake the model/controller/view - add some authentication and checks to ensure user_id is taken from a session, recipient ID as an ajax

Re: forms

2010-06-22 Thread Shaz
Try using $this-Form-create() instead of $form-create() in the view. Also make sure your form helper is enabled in the model. On Jun 22, 9:36 am, mirfan m.irfa...@gmail.com wrote: This is the script ?php echo $form-create(User,array('controller'='users','action'='register'));?              

Re: Mixing Sessions and Cookies?

2010-06-22 Thread Shaz
Cake cookies are session cookies. If you want to set browser cookies, use the php setcookie() function. http://php.net/manual/en/function.setcookie.php On Jun 21, 5:50 pm, DragonFlyEye dragonflyey...@gmail.com wrote: My cookie variables:         function beforeFilter() {                

Developing this darn function!

2010-06-22 Thread Shaz
More of a PHP / programming development question: I have an article that has (Category, Type, User, etc). Below the post I want to show the related articles, but I want them to relate together via the common attributes between articles (Category, type, user etc). At the moment I have a

SEO URL's (Slug?)

2010-06-22 Thread Shaz
Anyone have any documentation on the CakePHP slug? Can't seem to find much on it - just trying to get my URL's all nice and pretty for google without having to mess with Routing / creating seperate helpers and so forth to get 'em tarted up. Check out the new CakePHP Questions site

Re: efficiency vs conforming to standards

2010-06-18 Thread Shaz
$this-User-Photo-find() perhaps? From my understanding we should use the model associations (which provide an efficient sql query if i remember correctly) first to see if it gives us what we want, otherwise use findall/contain. On Jun 18, 7:21 am, Alan Asher a...@asteriskpound.com wrote: I have

Re: efficiency vs conforming to standards

2010-06-18 Thread Shaz
Also with the find() make sure you have recursive set to -1 or 0 to cut back on the excess data collection. On Jun 18, 9:53 am, Shaz shazam...@gmail.com wrote: $this-User-Photo-find() perhaps? From my understanding we should use the model associations (which provide an efficient sql query

Re: cakephp console, cake bake

2010-06-16 Thread Shaz
http://cakephp.org/screencasts/view/7 On Jun 15, 8:32 pm, jjnn jn.nor...@gmail.com wrote: Do i have to change the enviroment path to my cakephp console everytime i need to bake stuff on a new project? so like /home/jonas/lampp/htdocs/cakephp_projectA/cake/console

Re: Automagic Form (Drop down list)

2010-06-16 Thread Shaz
Whoa! So much info! Thanks all; beginning to like cake more and more day by day. I settled for using $displayField in the model; am trying to keep the controller as skinny as possible. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related

Automagic Form (Drop down list)

2010-06-15 Thread Shaz
Probably something really simple but I can't figure it out / find information on it: Got a form (add article) with a drop down list (categories). How do I get it to show the category names rather than id while still maintaining the id as the value? Check out the new CakePHP Questions site

Re: Containable() not working for $this-Model1-Model2-find('', array('contain') = 'Model3');

2010-06-03 Thread Shaz
', 'CommentRank'),       'conditions' = array('Comment.article_id' = $id)    ) ); [/code] That should give you the comments in a threaded format, with the article and comment rank attached. Enjoy,    John On Jun 2, 4:01 pm, Shaz shazam...@gmail.com wrote: $this-Article-Comment-find

Re: Containable() not working for $this-Model1-Model2-find('', array('contain') = 'Model3');

2010-06-02 Thread Shaz
] $this-Model1-Model2-find(    'threaded',    array('contain' = 'Model3') ); [/code] Is the above what is not working? Have you checked that an association/relationship is defined between Model2 and Model3? Enjoy,    John On Jun 1, 8:14 pm, Shaz shazam...@gmail.com wrote: I'm trying

Re: saveAll/Save not saving associations

2010-06-02 Thread Shaz
Course has many course_tees CourseTee belongs to course I thought all model class names be singular and camel cased; as in: Course has many CourseTee CourseTee belongs to Course Might help? On 2 June, 01:05, jjunior jrede...@gmail.com wrote: I'm having a problem trying to save/update some

Re: Router not working as expected

2010-06-02 Thread Shaz
It should be: Router::connect( '/blog_post', array( 'controller' = 'posts', 'action' = 'view', 5 ) ); Notice it's only one array. On 1 June, 23:07, blasto333 m...@chrismuench.com wrote: Router::connect(     '/blog_post',     array('controller' = 'posts'),

Re: Newbie question: URL linking

2010-06-02 Thread Shaz
Try: ?php if (!empty($user['social_media']['linkedin'])):? td valign=bottom align=center ?php echo $html-link($html-image('linkedin.gif', array ('alt' = 'LinkedIn' , 'align' = 'bottom')), {$user['social_media'] ['linkedin']}, array(), null, false); ? ?php echo

Re: How to pass array value from one ctp file to another ctp file

2010-06-02 Thread Shaz
Use elements, you can pass values between them: $this-element('whatever', $valuetobepassed); On 2 June, 13:16, Narendra Padala crazycake...@gmail.com wrote: Hi flocks, I am,  new to cake php  actually i want display one report, in the down i put the link download link for Excel. For that

Containable() not working for $this-Model1-Model2-find('', array('contain') = 'Model3');

2010-06-01 Thread Shaz
I'm trying to avoid putting $uses at the top of my controller and aiming to make do with model associations, but alas containable() doesn't work when trying: $this-Model1-Model2-find('threaded', array('contain') = 'Model3'); But: $this-Model1-find('threaded', array('contain') =

  1   2   >