d' => ... , 'Town' => array('id' =>
...)) so I do get the Town data. It is rather unfortunate that the data
formats are different as it makes the afterFind code rather ugly.
Mark
On Monday, November 19, 2012 5:37:59 PM UTC-5, Mark Wratten wrote:
>
> We ar
We are using Cake 2.2.2 and we have the following tables -
Article -> id, group_id, town_id, ...
Group -> id, town_id, ...
Town -> id, ...
The Article and Group tables need to modify their data with data from the
Town table, so in each of those Models we have an afterFind callback that
checks f
but I
> don't know how to make that things togerther!!
>
>
> 在 2012年9月3日星期一UTC-5上午12时22分41秒,Mark Wratten写道:
>>
>> Easiest is to use requestAction() in the homepage view.
>>
>> On Thursday, August 30, 2012 4:26:12 PM UTC-4, shyandsy wrote:
>>>
&
Easiest is to use requestAction() in the homepage view.
On Thursday, August 30, 2012 4:26:12 PM UTC-4, shyandsy wrote:
>
> I am kind of new guy on cakePhp. So the description as below:
>
> I hope to provide two function to users in the homepage, login and news.
> The login uses the view login and
$this->set('randword',
$this->Word->findById(rand(1,$this->Word->find('count';
On Wednesday, August 29, 2012 10:24:26 AM UTC-4, Nareh Tarasyan wrote:
>
> Thanks Marcus
>
> but u know what I did here... see:
>
> $this->set('rand', rand(1,$this->Word->find('count')));
> $this->
to like the new abilities of
Cake and you can really minimize the amount of SQL you need to put in your
code.
Disclaimer - there may be better ways to do the same thing that I have not
thought of.
Mark
On Tuesday, August 28, 2012 12:08:38 PM UTC-4, ceap80 wrote:
>
> Hi Mark,
Figured it out for myself, the subquery just goes in place of the table
name.
On Monday, August 27, 2012 6:17:05 PM UTC-4, Mark Wratten wrote:
>
> Is there a 'Cake' way of including subqueries in join clauses of SQL
> select statements?
>
> I'm looking to gen
Is there a 'Cake' way of including subqueries in join clauses of SQL select
statements?
I'm looking to generate something in the form of -
SELECT ... FROM table1
JOIN (SELECT DISTINCT key FROM table2 WHERE ...) table2 ON table2.key =
table1.key
I have been looking at joining tables in the docs
Option 2. is fine for simple stuff, i.e. grab a bunch of data from the
database and render it, but if there is any complexity to the logic, then
you end up loading your helpers with application logic, which in a pure MVC
world belongs in a controller or component. So in that case, requestAction
ot; city -- a
> name with a space or apostrophe would not match your regex. Because
> you want the city name to appear in URLs, you'll need to store both
> the display text and slug for each city.
>
> As for what's being passing as params, personally, I wo
I'm looking for some help with reverse routing as the documentation is a
bit thin. Particularly for use with rendering objects such as
PaginatorHelper.
I have a URL in the format - /state/city/page/slug which I route with -
Router::connect('/:state/:city/:page/*', array(
'controller' => 'pages',
Do you have var $belongsTo = array('Category', 'Product'); in your
CatProduct model?
On Thursday, August 9, 2012 10:43:43 AM UTC-4, André Luis wrote:
>
> Hi people, it´s me again!
>
> I am using a habtm relationship in my application, it works 100% fine...
> But the Product menu is created dinam
We are migrating an app from Cake 1.1 to 2.2.1. Our URLs are in the format
/state/town/page/slug and I have got the Router setup to forward route
correctly, but have not got reverse routing to work yet.
In function such as Html->link you can specific the URL as a string or
array, so you can set
Oops, should be
SELECT acos(sin(radians(P1.latitude)) * sin(radians(P2.latitude)) +
cos(radians(P1.latitude)) * cos(radians(P2.latitude)) *
cos(radians(P1.longitude) - radians(P2.longitude))) * 3963.1 AS distance
On Wednesday, August 8, 2012 12:47:37 PM UTC-4, Mark Wratten wrote:
>
> Gen
Generally, the Haversine Formula is the best one to calculate distance
between two points, given the lat/long of both the client and the hotel.
See http://en.wikipedia.org/wiki/Haversine_formula for more information.
SELECT acos(sin(radians(P2.latitude)) * sin(radians(P2.latitude)) +
cos(radians
In your beforeSave callback you could include a cal that does something
like - SELECT MAX(invoice_number) FROM table, then in your code, generate
the next number. Though if the code is going to be used by many people
simultaneously, you would need to create a unique index on that column, to
pre
One possible exception might be HABTM tables, consisting of just the
foreign keys to the related tables. MySQL only supports clustering on the
primary key and using a composite primary key would give you a covered
index, which in theory should perform a bit better. Though in practice, I
have no
On Friday, June 29, 2012 12:30:39 AM UTC-4, Ilie wrote:
>
> Hello,
>
> Another way to do this is to have one controller requestAction to fetch
> (as array or objects) all the data you need to render your modules, then
> using Elements or View Blocks to do the actual rendering of the modules.
>
Ye
That's the dilemma we are facing. The traditional MVC paradigm where a URL
maps to a controller and action is fine for simple sites, but for more
complex sites the model falls apart. Our site started as a straightforward
MVC design, but then the users wanted to add their own landing pages and
c
Often it is easier to create a model for the linking table, i.e.
OrderProduct and use belongsTo Order and Product rather than using HABTM
associations. Then query using that model.
Mark
On Monday, June 25, 2012 11:10:11 AM UTC-4, Caio Vncius wrote:
>
> Hello,
>
> need a help in a ratio of two-m
You can only paginate one way at a time, so presumably you can set the
associations dynamically depending on the parameters from jQuery. Though
separate models might be cleaner as you can hard-code the associations.
Mark
On Monday, June 25, 2012 11:41:16 PM UTC-4, 42startups wrote:
>
> As the t
You could consider storing your measurement data in a single column in the
measurements table as a JSON string. Thus the logic would be very simple as
you only need to convert to and from JSON. The downside is you won't be
able to easily query against values in the measurement data. Anything you
In you code you have 'className' => 'Bookings'. Shouldn't that be
'className' = 'Booking' ?
You should also be able to shorten it to - var $belongsTo =
array('Booking') as you are using booking_id as your foreign key.
MArk
On Wednesday, June 27, 2012 2:34:25 AM UTC-4, Sanfly wrote:
>
> Sorry,
We are migrating our site from Cake 1.1 to 2.1 or 2.2. The site is highly
modular which gives the site admins the ability to choose and position
modules on each landing page. Many of these modules are mini MVC blocks and
we are using requestAction to render them. So there can be as many as a
do
-custom-renderer-with-exception-renderer-to-handle-application-exceptions
>
> On Thursday, June 21, 2012 7:11:30 PM UTC+2, Mark Wratten wrote:
>>
>> We are rewriting our site to use Cake 2.1 and I'm really loving the new
>> features. The site has a back-end administrat
We are rewriting our site to use Cake 2.1 and I'm really loving the new
features. The site has a back-end administration function which I have
implemented as a plugin, including its own layout file. The admin function
runs off its own host name, so I have a line in bootstrap.php that checks
the
26 matches
Mail list logo