If you have a question, please show that you've done some work and let us
know what you've tried. Asking for someone to write your code for you isn't
going to result in positive responses. Also, be more clear. Let us know
what you're trying to accomplish and why you haven't been able to yet.
O
Just don't redirect then. The homepage should reload and the validation
errors should be shown.
On Tuesday, August 14, 2012 6:59:43 AM UTC-7, iFemke wrote:
>
> For a client website we want a newsletter sign up on the homepage, but we
> can't get this to work the way we want it.
>
> What's happe
You check it just like in the controller.
function testCookieWrite() {
$this->testAction('/posts/action_that_writes_to_cookie');
$result = $this->controller->Cookie->read('my_cookie_value');
$expected = 'yes';
$this->assertEquals($expected, $result);
}
Of course, you can always mock the c
Google uses Oauth[1] like Twitter. They even have a nice PHP library[2]
that should help speed things along for you.
1: https://developers.google.com/accounts/docs/OAuth2
2: https://code.google.com/p/google-api-php-client/
On Thursday, August 16, 2012 2:42:37 AM UTC-7, ivnrmc wrote:
>
> Hell
I agree with euromark. There's literally no point in comparing the two,
unless you are going to launch a production app in debug mode (uh).
On Thursday, May 31, 2012 8:12:59 AM UTC-7, euromark wrote:
>
> NO, i am saying that this shoudn't have been in this blog post in the
> first place
> it
CakePHP is just PHP, so there's no reason you couldn't use interfaces where
you wanted to. The users of the plugins would just need to understand that
they need to implement them.
On Thursday, May 31, 2012 4:07:13 AM UTC-7, Vinicius Dusso wrote:
>
> Hello all,
>
> Did everyone tried to use PHP's
Changing the ENTIRE folder to 777 is a TERRIBLE idea and a massive security
risk. I highly suggest you don't do it this way. Assuming you have the
proper user and groups on the folder, 660 should be sufficient.
On Tuesday, May 29, 2012 8:28:29 PM UTC-7, Nikhil Agrawal wrote:
>
> Try changing the
You can use Containable[1] to bring in relationship data. Something like
$this->Inventory->find('all', array(
'contain' => array(
'Profile',
'Item'
)
));
The above assumes Inventory is associated with Profile and Item (you didn't
give us the relationships).
-jeremy
1: http://book.
Actually it appears you already reported it :) I'll comment there.
On Thursday, May 24, 2012 7:17:12 AM UTC-7, jeremyharris wrote:
>
> I did some research and yes, I believe it is a bug. The problem is that
> when it tries to create the table and mark it as being created, it will
I did some research and yes, I believe it is a bug. The problem is that
when it tries to create the table and mark it as being created, it will
fail because the table already exists and then skips marking it as created,
which is what's needed in order for truncate to happen.
I'll add it on Ligh
So CAKE_CORE_INCLUDE_PATH should point to the Cake directory in the repo's
lib folder.
>From your setup, you should use
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
// points to /var/www/cake/lib (which has the "Cake" folder in it)
define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS
I answered on ask.cakephp.org for a long time, but it logged me out on a
regular basis and didn't give me notifications when people commented or
asked further questions, so I would have to revisit questions just to see
the activity. I've started answering on StackOverflow instead. I agree that
e are numerous forks)
On Monday, April 30, 2012 8:09:33 PM UTC-7, double07 wrote:
> Hi Jeremy,
>
> Not having much luck with the saving manually option, do you having
> any working examples of drag and drop (jquery) I can look at?
>
> Thanks,
>
> -Brett
>
> On Apr 17,
Why didn't you use the $belongsTo array I gave you? Your belongsTo has
changed the aliases from MainCity to main_city, so paginating by MainCity
will not work.
Rename the aliases to be CamelCased and try again. Also, debug the results
of $this->paginate() to make sure it includes the MainCity a
le was a different then my actual code (I know I should
> have just used it)
>
> I have two cities per book.
>
> IE
>
> main_city_id (where it was written)
> billing_city_id (where the author wants to get paid)
>
> How do I distinguish them? I can't use City.nam
ate from the book model to be able to sort
by Book, Author or City
On Thursday, April 26, 2012 3:06:34 PM UTC-7, Hill180 wrote:
>
> City hasMany books, books only have one author.
>
> City.name didn't work
>
> var $hasMany = array(
> 'Book' => array
Try:
if ($this->Paginator->counter(array('format' => '%count%')) == 0) {
// no records, don't show links!
}
-jeremy
On Thursday, April 26, 2012 9:17:49 AM UTC-7, JonStark wrote:
>
> How can I hide the "<< Previous Next >>" that appears if there is no
> pages to paginate ?
> I think this is po
I would take cues from the Media plugin, which uses binary data in some of
its testing library.
Test data:
https://github.com/davidpersson/media/blob/next/tests/fixtures/test_data.php
Where test data is set up:
https://github.com/davidpersson/media/blob/next/tests/cases/models/behaviors/base.te
Is City a hasOne or belongsTo relationship? If so, and your find code is
using contain or recursive to include those in the results, you can do this:
$this->Paginator->sort('Where Written', 'City.name');
Check your data and SQL queries to see if it's joined that way.
On Wednesday, April 25, 201
You can run it in the CLI and it should work fine.
As for changing the warning, I'm not sure what you're looking for. Is it
the styling or how the report is generated that you don't like? If it's the
styling, then use CSS. If it's the report itself, I think theoretically you
can change it by cr
Rodrigo is right. By mocking the save method you are basically saying that
that method does nothing, unless you specify a return value. Mocking the
save method is probably not the way to go. If you're using a test database
and fixtures, the data will be stored in a database and wiped clean when
Yes, as defined in the transferTo function in your model. Here's a sample
one that sticks it under a user directory and uses a UUID as the filename
so there aren't conflicts (so something like
/media/transfer/doc/user/550e8400-e29b-41d4-a716-44665544.doc):
function transferTo($via, $from) {
7;s the intended functionality).
On Tuesday, April 17, 2012 11:13:53 PM UTC-7, muka wrote:
>
> Probably a more correct way could be
>
> function isAuthorized(){
> return $this->Auth->user();
> }
>
>
> Il 18/04/2012 00:24, jeremyharris ha scritto:
>
> Sett
Setting $this->Auth->authorize = array('Controller'); tells the
AuthComponent where to run the `isAuthorized()` method, in this case, the
Controller. You can find more info here:
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-controllerauthorize
On Tuesda
I realized after posting that the post I referenced assumes MySQL, but the
idea of indexing is relative nonetheless.
On Tuesday, April 17, 2012 8:20:05 AM UTC-7, jeremyharris wrote:
>
> It's quite possible you're just missing indexes[1], which would be a huge
> performance
It's quite possible you're just missing indexes[1], which would be a huge
performance problem. Also, make sure the engine is innodb.
1: http://blog.loadsys.com/2008/03/19/cakephp-12-tuning-the-acl-via-mysql/
On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>
> I'm not expert in CakePH
If it's more than two files (behavior + test case) it's worthwhile to point
out that plugins are not only good for redistributing your code, but it's
also good for packaging your tests and everything in a different repo that
has its own history and that you can submodule via git. This assumes th
> Now I understand this, I'd expect them to be displayed like
> .../brand[0]:Dell/brand[1]:Apple/. Currently (now I've tweaked the plugin)
> the values are separated with a pipe, for example /brand:Dell%7CApple but
> as I mentioned above, this causes problems as the search plu
You could try looping through the files array and saving them manually:
foreach $_FILES['files'] as $file {
// create data array containing fields such as a foreignKey, model, etc.
and save them as individual records
}
Or, instead of using the multiple option, you can try processing them each
a
That is the proper name, because PHP sees that and creates an array with
the values within that array. How else would you get multiple values for
the same group?
When you submit the form, for example, the data is populated like this:
// $this->data
array(
'Server' => array(
'brand' => arr
s experience pulling posts from a
> (non-hosted) WP Blog into a Cake website, and can will point me to some
> good documentation on how to do it.
>
>
> On Thursday, April 12, 2012 11:25:54 AM UTC-5, jeremyharris wrote:
>>
>> 1. If you can't connect to the database how
working on codeigniter. so its little difficult to work
> on cakeph though its on MVC.
>
>
> On Thursday, 12 April 2012 21:58:31 UTC+5:30, jeremyharris wrote:
>>
>> You can read more about the structure here:
>> http://book.cakephp.org/2.0/en/getting-started.html
You can read more about the structure here:
http://book.cakephp.org/2.0/en/getting-started.html
Cake doesn't work like WordPress (which uses header, content and footer
templates). It uses proper MVC, that is a layout (kind of like the header
and footer templates combined) and view (kind of li
sure if I can connect to the WP database. I was
> hoping someone could point me to an existing plugin/component that does
> what I need it to do. I'm not interested in writing something from scratch.
>
>
> On Thursday, April 12, 2012 9:29:29 AM UTC-5, jeremyharris wrote:
>>
As long as you can connect to the WP database, I don't see why this would
be that hard. Just set it up as a separate database connection, set up some
models and you're good.
It really depends on how crazy you want to get. For example, do you want to
form relationships that get the meta info, ta
I don't see why this wouldn't work, since Aro's are a tree anyway. For one
of my projects, I technically have a 10 level deep Aro setup, where each
parent group inherits its children's permissions (that is, if you are of a
higher group you can access everything lower groups can). The same applie
That error is because it's looking for Group.1, which is missing from your
posted ARO tree.
On Sunday, March 18, 2012 4:41:12 AM UTC-7, mohit wrote:
>
> Hi Experts,
>
> Need some help,
> I am in process of learning of Cake PHP. I was creating an app which needs
> ACL feature.
> While reading var
Here are some basic debugging steps but we won't be able to help you until
you narrow it down a little (is it a PHP error, a problem with your CakePHP
code, a problem with your database connection?).
Turn on debugging if it is not already: /config/core.php,
Configure::write('debug', 2)
Make su
g, 8. März 2012 16:23:45 UTC+1 schrieb jeremyharris:
>>
>> I've had no problem with ajax forms and the security component. The token
>> is still added and it still goes through. It only blackholes if you
>> dynamically change that field with javascript.
>>
>>
I have no idea if css and images will load properly from the vendors
folder. It's probably looking for those assets in the webroot folders.
The anchor should be stored in $this->params['url']['#'].
It seems weird to be rendering a complete site within Cake.
On Thursday, March 8, 2012 8:53:48 AM
Based on the controller code I wrote, it would be /SkillsMat/edit_scores
The .php is appended in the controller. I have no idea if it will work, it
was just an idea more than anything.
On Thursday, March 8, 2012 7:59:16 AM UTC-8, Daniel wrote:
>
> OK, I put the directroy "SkillsMat" in the vendo
Pages isn't probably the right place to put it.
I would just make it a .ctp file, or create a view class that uses the .php
extension. So if your pages controller used that view it would dispatch
something like /pages/SkillsMat to /views/pages/skills_mat.php. If you need
the .php extension to
WordPress is full of globals and a bunch of other garbage that would make
it nearly impossible to work with *any* other codebase. You would be much
better off creating models that connected to WP's database and tables.
That's my suggestion.
On Friday, March 2, 2012 3:27:53 PM UTC-8, 85VicWagonG
Where does Cake "rely" on a CSS file. How could any PHP program rely on a
css file, for that matter?
On Thursday, March 8, 2012 6:40:15 AM UTC-8, Phil wrote:
>
> Bad programming by cake php here. This bug still exists in version
> 2. Why does it rely on a css file existing? A lot of people wi
I've had no problem with ajax forms and the security component. The token
is still added and it still goes through. It only blackholes if you
dynamically change that field with javascript.
On Thursday, March 8, 2012 7:20:34 AM UTC-8, euromark wrote:
>
> well, with ajax and dynamic field injectio
t; to web.config (which would usually break the images but enable the
> controller/action pages), nothing actually changed. I expected something to
> be different, or at least more broken, but it all seemed the same.
>
> On Wednesday, March 7, 2012 4:05:33 PM UTC-5, jeremyharris wrote:
Use DebugKit and see if it's in the list of loaded helpers. If it's not,
then Cake can't find it. If it is, then perhaps you're referencing it
incorrectly.
On Wednesday, March 7, 2012 8:31:23 AM UTC-8, mohit wrote:
>
> Hi Experts,
>
> I am using this tutorial to set up an excel export helper
>
>
Enabling the Security component should be the first thing you do. You are
immediately protected against form tampering.
Something to note on enabling it on an existing app: test it thoroughly!
Checkboxes with no hiddenField will blackhole (at least in 1.3) comes to
mind.
On Wednesday, March 7,
Make sure your Physical Path is pointing to the webroot directory, not the
root of the app. I've used the .htaccess files (using ISAPI mod rewrite)
but never got it to work by pointing to the root of the app. I always had
to point to the webroot directory so the assets worked.
On Wednesday, Mar
So it looks like your joins are working (am I wrong) but you're getting
null data joined for those who are missing photos. Is this correct?
If so, try adding a condition:
$conditions = array(
'Product.category_id'=> $cats
'not' => array(
'PhotoBig.id' => null,
'PhotoSmall.id' => null
)
);
I would get all users who *are* following and then look up everyone except
them.
$followers = $this->User->Follow->find('all', array(
'conditions' => array(
'Follow.followed_by' => $this->Auth->user('id')
)
));
$nonfollowers = $this->User->find('all', array(
'conditions' => array(
'not' => a
You could use UUIDs instead which are automatically created by Cake and a
nice replacement for auto increments.
On Monday, March 5, 2012 3:42:39 AM UTC-8, Kosmo wrote:
>
> Hi there,
>
> I know this could be a critical hole in my application,
> anyhow - is there a way to set an article-id like
No problem. Enjoy Cake!
On Friday, March 2, 2012 1:09:16 PM UTC-8, Graham wrote:
>
> Thanks, so simple when you know how.
>
> Cheers
>
> Gj
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and
You can just add it to the data you save in the controller action.
Something like:
function add() {
if (!empty($this->data)) {
$this->data['Model']['amount_plus_fee'] = $this->data['Model']['amount'] +
10;
$this->Model->save($this->data);
}
}
So amount_plus_fee wouldn't be in the form necessari
Sounds like an iOS question
http://stackoverflow.com/questions/5537297/ios-how-to-perform-a-http-post-request
On Thursday, March 1, 2012 1:15:21 PM UTC-8, 8vius wrote:
>
> I've set up my RESTful web services and I'm trying to POST to my add
> method, how would the URL be to do this? I haven't
know that PHP had an interactive shell. I believe the closest
> I got was the -r parameter!
>
> On Thu, Mar 1, 2012 at 3:55 PM, jeremyharris
> wrote:
> > I don't know of any, but that might be a fun contribution to add :)
> >
> > I'd create a lighthouse R
Your first resource should be the book[1]. You can also look at
screencasts[2] and sign up for classes that will teach you the basics and
get you going[3].
1: http://book.cakephp.org
2: http://tv.cakephp.org/
3: http://training.cakephp.org/
On Thursday, March 1, 2012 5:44:07 AM UTC-8, mohit w
Sounds like you're creating the form wrong in the view. What's the code in
the view for your form?
On Thursday, March 1, 2012 2:48:55 AM UTC-8, boobalan wrote:
>
> i am creating a blog application
> i've some issues while using ajax in forms
>
> Warning (2): array_merge() [function.array-merge]
I don't know of any, but that might be a fun contribution to add :)
I'd create a lighthouse RFC ticket and post some code to see what people
(and the core team) think. It shouldn't be too hard to code, either.
On Wednesday, February 29, 2012 7:33:58 PM UTC-8, Simon Males wrote:
>
> Hello,
>
> Ar
It would be easier to debug your code with... you know, code. Can you post
your isAuthorized function please?
On Wednesday, February 29, 2012 3:31:34 PM UTC-8, JT wrote:
>
> I'm using isAuthorized to check if the user is an admin or a user. If a
> user tries to access an admin function I want th
y as the 'User' had already
> been unset by the Coupler. I've therefore had to roll the change back and
> go back to the drawing board for now.
>
> Keith Gorman
> *Class Outfit*
> **
> keithgor...@classoutfit.com
> www.classoutfit.com
>
> On 29 Feb 2012, at
Or ternary!
$class = $active ? 'active' : null;
On Wednesday, February 29, 2012 1:07:08 AM UTC-8, euromark wrote:
>
> just use conditions then
>
> if ($condition) {} else {}
>
> basic PHP one-o-one
>
>
> On 29 Feb., 09:56, Kiran Ambati wrote:
> > Hi stephen,
> >
> > I want add class to onl
Are your versions of PHP the same on both setups? Remember that for PHP
4.x, you'll need to define $name in your models.
On Tuesday, February 28, 2012 4:49:18 PM UTC-8, Waterschaats wrote:
>
> I have a weird problem with Models and array's
>
> I moved a website from a test server to the live ser
I would simply create a component called Cart and add a read() method to
just pull the products. Something like this:
class CartComponent extends Object {
var $components = array('Session');
function read() {
$Product = ClassRegistry::init('Product');
$productsInCart = $this->Session->read('Cart
ach out to David
> yesterday, hoping to learn more from him so that we can implement this
> properly and will report back.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 28 Feb 2012, at 21:15:25, jeremyharris wrote:
>
> I didn't say I agr
in model get on with
> its work.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 28 Feb 2012, at 15:45:29, jeremyharris wrote:
>
> It should only unset the data if you are creating the User and it's
> missing the 'file' key. If you are u
Generally the response to this question is: when it's done.
It's important to understand that CakePHP is a completely volunteer-driven
framework. This means that people (core team and otherwise) put in unpaid
time after their normal job. Because of this, there isn't a hard and fast
release sche
The 'checked' key just checks the checkbox. If you set the value to '0'
Cake (well, PHP) sees that as an empty value and therefore assigns it a
value (the default being 1).
You have a few of options here:
1. Use unconventional string values like 'on' and 'off'
2. Flip the results in the model be
It should only unset the data if you are creating the User and it's missing
the 'file' key. If you are updating, you shouldn't *need* the 'file' key.
That said, you can probably get away with passing an empty (or a path to a
default image) file key when you are creating the User using a hidden
this is why we have version control, after all :)
On Monday, February 27, 2012 5:16:12 AM UTC-8, Thiago Belem wrote:
>
> +1 to euromark
>
>
> 2012/2/27 euromark
>
>> why dont you guys just try it
>> its not like it will explode and kill you or something
>
>
--
Our newest site for the community:
You should only need to disable them if they are being manipulated with
JavaScript.
That said, I've had issues trying anything other than disabling the entire
HABTM data:
$this->Security->disabledFields = array('BusinessHour');
This is because the way Cake compares the fields does not take int
It sounds like you should probably just include your own 'join' 'key[1] in
your find statement then.
1: http://book.cakephp.org/1.3/en/view/1047/Joining-tables
On Sunday, February 26, 2012 4:15:18 PM UTC-8, padma wrote:
>
> Hi,
>
> I have the model configured with belongsto association.
>
>
There's nothing really out of the ordinary going on here, it's basic Cake
stuff.
Your ajax form should POST the data to /users/login. Then your controller
action can look something like:
public function login() {
if ($this->Auth->login($this->data) {
// set flash
// set user data via $this->Aut
Check out Set::filter()
On Sunday, February 26, 2012 8:12:10 AM UTC-8, Reynier Pérez Mira wrote:
>
> I need to run a save/update query but only update those fields that aren't
> empty. My form contains a FILE field and if I don't upload any file then
> when the save() is executed this field goes
a[$Model->alias]['delete'])
> && $Model->data[$Model->alias]['delete'] !== '0')
> {
> $Model->delete();
> unset($Model->data[$Model->alias]);
>
t_id = HospitalAdmission.subject_id'
>
> ...
> )
>
>
> ?
>
> On Feb 22, 6:16 am, Stephen Speakman
> wrote:
> > Something i need to bear in mind when mapping my models, no joining
> > between two connections.
> >
> > Could yo
n using a separate
> Attachment table, does this mean I don't need the Coupler element?
>
> On Feb 24, 2:19 am, jeremyharris wrote:
> > What behaviors are you using besides Transfer? Coupler tends to mess
> with
> > the data because it expects *just* the fields in
What behaviors are you using besides Transfer? Coupler tends to mess with
the data because it expects *just* the fields in the Media.Attachment
model. Try removing Coupler if it's attached (since you're not using it).
Also, unit tests are your friend. It would be much easier to try things and
d
It sounds like your $dropdownOpts var might be incorrect. What is it when
you debug?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To u
Yep, look at the PaginatorHelper docs[1].
1:
http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper
The book is your friend :)
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask
No problem. Sometimes it helps to have another person look at it :)
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from th
It's because the item Country does not exist on Information. Models are
always singular, so where you have Countries defined in your Information
belongsTo you should have Country instead.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new Cak
Bake the model Person or tell your People controller to use the People
model.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscr
The model it is probably looking for is Person, which in english is the
singular of People.
So PeopleController uses the Person model
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help ot
To include CSS and JS, use the HtmlHelper[1]. This will include files from
/webroot/css and /webroot/js
$content_for_layout holds the content from the rendered view. All you need
to do is echo it in the layout. There isn't anything more that you need to
do with it.
1: http://book.cakephp.org/2
What do you mean by corrupted? It should fail gracefully and stop the save
process if there's an error.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP relate
Depends what you mean by "make an action." Do you want to modify the
timestamp each time they modify the database, or do you want to modify the
timestamp each time they call an action, like /controller/action?
If it's the first, then use a behavior. There are a few "logging" behaviors
out there
You can do this in a single find() call, using containable. (It will still
create many mysql queries because that's just the way it needs to be done,
however it will filter all the data for you).
Something like:
$this-> Customer ->find('all', array(
'conditions' => array(
'Customer.id' =>
That is weird, seeing as debug() uses print_r(). Try debug($results, false)
to see what you get. If it shows info, the problem lies in the html entity
encoding. Maybe you have html in your results that just cause it to look
like nothing's there (view source to see what's really there).
--
Our
You probably get the warning because you are including the sql log element
somewhere else (like in your layout). Remove it and it will show up in
debug kit.
As for the empty results, do you have behaviors attached or anything that
might be touching the data?
--
Our newest site for the commun
See: https://github.com/davidpersson/media/issues/66
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send
Just to be clear, your DocumentRoot is correct either way. If you point it
to webroot, there's less work on the server's end to find it.
Like kdubya said, make sure debug is on. If you're receiving a 404 error
that means something is broken within cake (missing method, model, etc) and
in produc
Does Containable not work?
$this->HospitalAdmission->find('all', array(
'contain' => array(
'Subject' => array(
'Contents'
)
)
));
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.o
The reason is because $text is empty. HtmlHelper::div uses HtmlHelper::tag
which documents that it will only print the starting tag if no text is
within the tag. I personally don't like this behavior. That's why you'll
see things like this in baked code
echo $this->Html->tag('div', $post['Post'
Well for one you're calling a find twice, once in $this->Quote->find('all')
and again in $this->paginate(). You only should be calling
$this->paginate() which will perform the find for you, and limit the
results to the pagination settings.
--
Our newest site for the community: CakePHP Video Tu
In the view you would create a helper that had the function on it. Your
controller includes that helper.
I'm not trying to be mean here, but even to use CakePHP you have to have a
semi-decent grasp on programming PHP. Understanding functions, classes,
scope (the $this keyword) are all still imp
Well, just think of how the function will be used. In CakePHP, you can
split things up into components, helpers and behaviors as well. CakePHP is
just PHP so you can technically put the function anywhere. If you put it in
your AppController all of your controllers will have access to it. If you
Let's see your model associations set up, where the afterFind is, and what
find call you are using. That will probably give me a better understanding
of what's going on.
Also have you looked at virtual fields? They might be an answer to your
problem.
--
Our newest site for the community: Ca
You can by just browsing to the 1.3's console directory and running it from
there
cd /path/to/1.3app/cake/console
cake -app /path/to/1.3app bake
All putting it in your path does is make it easy to call cake bake from
anywhere.
--
Our newest site for the community: CakePHP Video Tutorials
ht
Remember that there's a separation between controllers and models. The
model really doesn't need to know the method (and really shouldn't). I
agree with euromark, attach it within the methods you want to use it. Or,
attach it in beforeFilter for a little more organization.
--
Our newest site f
1 - 100 of 195 matches
Mail list logo