Try this
function beforeFilter() {
$this->RequestHandler->setContent('kml', 'text/xml');
// $this->RequestHandler->setContent('kml',
'application/vnd.google-earth.kml+xml');
}
On Thursday, September 24, 2009 7:01:18 AM UTC+2, Kyle Decot wrote:
>
> I am attempting to create KML pages for my site
Hi all,
Am I crazy, or it is impossible to search inside the new ticket system
at http://code.cakephp.org/tickets? Wanted to report an issue, but I'm
unable to filter the ticket list to check whether it has been already
reported or not.
Of course it's possible to google "site:http://code.cakephp
I'm struggling with translate too but I'll try to help.
Every line in the i18n table it should have the model, the locale, the
foreign key to the model item id and the translated content.
If you want to translate only one field per item only one row should
be added to the i18n table so what I se
This happens to me quite frequently:
I define on my Post model a nifty afterFind method which alters in
somewhay the results. And it works nice when I do a $this->Post->find
().
Then I want to, say, find all posts from an author (Author hasMany
Post):
$conditions = array('Author.id =' => 123);
A *VERY interesting* reading on the subject:
http://blog.fedecarg.com/2008/06/28/a-modular-approach-to-web-development/
"MVC is about loose-coupling, and Modular Programming takes that
concept to the extreme. A modular application can dynamically load and
unload modules at runtime, completely se
is can be done with PHP and Cake. Or at least that's what I have
came up to.
I find this is very interesting because such a plugin architecture can
be later applied to many other applications and scenarios.
Feel free to share your thoughts or experiences here in this
> Our lame but necessarily practical/quick solution was to give up on
> plugins. [...]
I'm afraid we will do the same. This application will have *a lot* of
Javascript which also needs to be modular and extensible. I think
there won't be any problems making pluggable components for the client
par
Hi all,
Consider a big Cake application which could be divided into a small
core and many plugins providing extended funcionality. Pretty much as
Wordpress is built: tiny, efficent core, and pluggable extensions
connected by hooks. The same applies to MediaWiki, to cite just
another wide known ex
I forgot to add that this proposal is consistent with the way the
validation errors are currently defined in the models and not in the
views (despite they can be overriden in the view too).
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
Hi all,
Almost every input field in a app comes with a tag and a
"title" attribute (hint). Therefore this structure is pretty common:
echo $form->input('login', array('label' => 'Your login', 'title' =>
'No spaces; only alphanumeric characters'));
echo $form->input('name', array('label' => 'Ful
On 4 ene, 02:13, thatsgreat2345 wrote:
> Use Ajax?
That's the alternative I have been thinking about, but I'm trying to
avoid AJAX because of WCAG/WAI accessibility guidelines.
> On Jan 3, 4:07 pm, Jaime wrote:
>
> > Hi all,
>
> > I wonder if it's possi
Hi all,
I wonder if it's possible to have two different forms for two
different (but related) models in the same page.
Imagine a page where the logged in user can edit his profile (model
Profile) as well as to add a photo into his gallery (model Image).
create('Profile'); ?>
...
create('Image'
Hi all,
I did a nice app which makes heavy use of Inflector::slug() to convert
"My Strings" inoto "my_strings".
However, now I find that the core slug() function is not working with
my uppercase accentuated wovels (Á, É...). Of course I can patch
inflector.php, but I DON'T like to touch Cake's c
Check /cake/libs/model/behaviors/tree.php for method recover():
/**
* Recover a corrupted tree
*
* The mode parameter is used to specify the source of info that is
valid/correct. The opposite source of data
* will be populated based upon that source of info. E.g. if the MPTT
fields are corrup
Hi all,
I would like to recieve a daily diggest of what has happened in my
app, as well as to display it on the admin interface. So I decided to
implement a custom log function, because the core one (CakeLog) can't
log to database.
Then a problem arise:
1.- If I do it with a model/controller pa
I didn't knew these. Thanks!
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECT
Interesting topic Luigi7up.
I achieved exactly this in a very simple way with AD7six' Polymorphic
behavior:
http://bakery.cakephp.org/articles/view/polymorphic-behavior
I successfully use it for tagging many models in my app and for
geolocalization. In the first case, I can tag different models
Another workaround for this:
class AppModel extends Model {
function paginate($params) {
return $this->Behaviors->Mybehaviour->paginate($this, $params);
}
function paginateCount($conditions) {
return $this->Behaviors->Mybehaviour->paginateCount($this,
$conditions);
}
}
I don't
Of course I can but, shouldn't be this in the core?
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send
It is possible to define custom paginate() and paginateCount() methods
in a model.
But sometimes many models can share that same pagination methods, and
therefore they could be defined in a single behavior. However, the
core paginate() method in Cake's core (default) controller only calls
the cu
Try disabling all your routes in /config/routes.php. Also, check the
value of 'Routing.admin' in /config/core.php.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to
I'm afraid I don't understand your question. I tried your example and
I got a link to /neue_anzeige, as expected.
If you want to pass a parameter to the controller, try:
Router::connect(
'/neue_anzeige/:day',
arr
Thank you Michael. Your approach seems valid, but after having a look
at the paginator helper too I found the undocumented ['?'] index in
the $options['url'] array:
$paginator->options['url']['?'] = 'param1=value1;param2=value2'
That appends the query string to the pagination links of my search
Welcome to the club:
http://groups.google.com/group/cake-php/browse_thread/thread/81241ffe0ddb4c4c/c5581fd8cd6a194a?lnk=gst&q=session#c5581fd8cd6a194a
http://groups.google.com/group/cake-php/browse_thread/thread/a6abc82e0b317b68/73e8bffdf0beb9cd?lnk=gst&q=session#73e8bffdf0beb9cd
--~--~-~
class AppController extends Controller {
var $components = array(..., 'RequestHandler');
function beforeRender() {
if ($this->params['isAjax'])
Configure::write('debug', 0);
}
}
--~--~-~--~~~---~--~~
You received this message because you are subsc
I'm not sure if I'm understanding you correctly, because seems to be
trivial:
class my_controller extends AppController {
var $data;
function MethodA() {
$this->data = 'hello world';
}
function MethodB() {
die($this->data); // hello world.
}
}
Or even:
class my_controller extends AppContro
Thanks schneimi, but I'm already familiar with named parameters. The
problem is that after submiting a HTML form where data is passed by
GET, you are driven to a new url with the query string (/?
param=value) instead of a nice named-params one (/param:value).
Of course I can force a redirect to
- but that's only my point of view.
Give some feedback if you implement a different solution.
Cheers,
Jaime.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, se
Hi there,
I've built a search engine for my app and defined a route for it:
Router::connect('/search/companies/*', array('controller' =>
'companies', 'action' => 'search'));
The search box is a HTML form sent via GET method. So url are like
this:
/search/companies?where=london;name=bla
Notice
I posted the same problem just three days ago, whichs still remains
unresolved:
http://groups.google.com/group/cake-php/browse_thread/thread/a6abc82e0b317b68/73e8bffdf0beb9cd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Try named parameters. Something like:
Router::connect('/webstats/:vhost/:type', array('controller' =>
'yourcontroller', 'action' => 'youraction'), array('type' => 'foo|bar|
bla'));
The last array is optional, just in case you want to restrict your
chart type to "foo", "bar" and "bla".
Then you
It is not possible, but you can always extend the find() method in
your Appmodel if you require that funcionality often:
class AppModel extends Model {
function find($type, $params)
switch ($type) {
case 'indexed' : return Set::combine($this->find(...), '...');
default: return parent::
Weird: it only happens when Routing.admin is set to 'admin'. When I
change it, everything works perfectlly.
On 29 ago, 13:13, Jaime <[EMAIL PROTECTED]> wrote:
> I've been dealing with this for two days; hope it's not a lame
> question. On 1.2.0.7296 (RC2) I set
The solution is to use $html->link('anchor', array(..., 'admin' =>
true'), but unfortunatelly it isn't working neither (http://
groups.google.com/group/cake-php/browse_thread/thread/
a6abc82e0b317b68#).
Anyway, I wonder why is 'admin' an special prefix. I mean, why there
isthe possibility to set
I've been dealing with this for two days; hope it's not a lame
question. On 1.2.0.7296 (RC2) I set "Configure::write('Routing.admin',
'admin')" in core.php, and my app_controller.php looks like this:
class AppController extends Controller {
function beforeFilter() {
die(pr($this->Session->r
Hi all,
I can't find out how to correctly link my actions when using prefix
routing. I have two actions: index() for public users, and
admin_index() for the admin, which dumps extra data:
core.php:
Configure::write('Routing.admin', 'admin');
news_controller.php:
class NewsController extends App
Hi all,
I'd love to use some Cake core functions (like Set::extract or
Inflector::slug) in a non-cake app (command line script). Is there a
preferred way to do this, or should I include one by one all the
affected files and their dependences?
--~--~-~--~~~---~--~~
Try this: http://www.defusion.org.uk/demos/060519/cropper.php
Requires the Prototype js library.
-- Jaime.
On 2 jul, 03:10, Kyle Decot <[EMAIL PROTECTED]> wrote:
> I am attempting to find a image cropper but cannot find something like
> the following:
>
> you have a predefin
> We are planning to build a new eCommerce application in cakephp...
There is an interesting e-Commerce project driven by CakePHP in which
I have participated: Bakesale (http://bakesalehq.com). They are
planning to release version 1.2 these days. I love it and it's very
well designed. Maybe you c
I have to THANK YOU Christian...
I tried everything that came to my mind regarding the $paginator-
>options['url'], but I didn't found that the error was in the route
and was so simple to solve.
So, for anybody having the same problem in the future... be sure to
append the trailing asterisk like
Hi all,
It seems that Paginator helper is not correctly constructing the
links. Doing this:
$paginator->options(array(
'url' => array(
'controller' => 'posts',
'action' => 'index',
)));
Results into a nice /posts/view/page:1 link, as expected. Now assume a
route like this is assigned:
It seems that Paginator helper
$paginator->options(array(
'url' => array(
'controller' => 'posts',
'action' => 'view',
)));
/posts/view/page:1
Now assign a route link
Router::connect('/pagina/*', array('controller' => 'pages', 'action'
=> 'display'));
--~--~-~--~~
Thank you very much for those two valuable links. The first one is
just what I was looking for! And the second a very interesting reading.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to th
> I am new in cakephp. It provides me a easy tool to validate from sever
> side the fields of any form. I want to provide clientside validation
> also using javascript. Is there any easy solution?
You can do it with Prototype [1] (demo available at [2]).
But anyway, why would you like to validat
Hi all,
I have a working setup of ACL + Auth (CRUD mode) in top of my (let's
say) Roles, Users and Post models.
When somebody requests a Post, access is granted or denied depending
on the user's role. That's great! I added *no new logic* to my
controllers to do that. Cake automagically asks the
Hi all,
For certain routes it could be useful to have "-" or any other
separator instead of "/".
So something like /jobs/london could become /jobs-london or even /jobs-
in-london (using "-in-" as separator), which usually ranks better in
search engines (as it's thought to be a main page, not a s
Same for me (1.2.0.7125 RC1).
I (apparently) solved id by setting Session.checkAgent = false and
Security.level = medium in config.php.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to thi
nd it should work fine. :)
A model for the join table? Why? It's not necessary, beacause it
becomes auto-modelized for you, so it can be accesed like this: $this-
>Post->PostsTag->findAll();
Cheers,
Jaime.
--~--~-~--~~~---~--~~
You received this messag
On 17 jun, 16:44, davidpersson <[EMAIL PROTECTED]> wrote:
> I've got exactly the same problem and only came up with the same
> workaround..
> Hope anyone out there knows a solution for this.
I can't believe nobody has run into this before and found a better
solution!
Cheers,
J.
--~--~-~
On 17 jun, 23:05, Joel Perras <[EMAIL PROTECTED]> wrote:
> Read: tinyurl.com/4kbe9q
Thank you Joel.
So all the problem was that I didn't set a 'id' field in the join
table. I thought that an 'id' was only required to modelized tables,
not to join tables. At least, I've never set id's before on
Yet Another HABTM Question (sorry, but I've read the fine manual and
found nothing on this).
To stick on the traditional example:
Post belongsTo User
Post HABTM Tag
$this->data = array(
'Post' => array(
'id' => 1,
),
'User' => array(
'name' => 'John Doe',
),
'Tag' => array(
Buah, sorry to bother the Group with YAHABTMQ (Yet Another HABTM
Question), but I'm really stuck with this.
I guess Cake can not save extra fields in HABTM join tables. I haven't
seen nothing related to this in the nice book. To stick on the "Post
HABTM Tag" example, this is not working:
$this->
Thanks francky06l,
But "atomic" is set to true by default (according to the
documentation), and I have already traced the DB calls, as you can
read above. The ROLLBACK is being called, but it's not affecting the
INSERT operation, because a SELECT is being made after.
Is that a bug?
--~--~---
BTW I'm using Cake 1.2.0.7125 RC1 (model.php revision 7118)
--~--~-~--~~~---~--~~
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 unsubscribe from this grou
Hi group,
I'm not sure if I'm misunderstoonding something or if I've found a bug
in /libs/model/model.php.
It happens when I use saveAll() to save a bunch of records of the same
model:
$this->Mymodel->saveAll($this->data['Mymodel'], array('validate' =>
'first'))
This should do two things:
1.-
On 31 mayo, 16:12, Alessio <[EMAIL PROTECTED]> wrote:
> I need to use themonthsin italian...
> What do you suggest?
Try this in yout /app/config/bootstrap.php:
setlocale(LC_ALL, 'it_IT.utf8');
Run 'locale -a' in your server's box to test which locales are
available.
--~--~-~--~~-
On 2 jun, 15:21, mbavio <[EMAIL PROTECTED]> wrote:
> Have you heard of something called ACL?
Yes, I have.
But ACL does not solve this problem. ACL is a way to define how
priviledges are assigned to roles and users. The question here is
which is the best design for a multi-role application built
On 4 mayo, 17:02, baur79 <[EMAIL PROTECTED]> wrote:
> Hi every one !!
>
> i have model "contract" and
> 3 types of users manager / lawyer / broker
>
> each of them have different privileges on this model
>
> for example:
> manager can only edit several fields
> lawyer can do everything on model
On 2 jun, 14:20, Jaime <[EMAIL PROTECTED]> wrote:
> Cake's admin routes are nice, but are designed for a simpler scenario
> (Users vs. Admins), so won't help here.
Since CakePHP 1.2 there is the possibility to define custom prefix
routing, so it can be possible to do s
Hello everybody,
This topic is quite similar to
http://groups.google.com/group/cake-php/browse_thread/thread/35900a65ab04ab05/92b6e71a451c35d0?lnk=gst&q=roles
which remains still unresolved.
It's just about a common scenario while building a corporate Intranet.
There is a fine DB and many model
On 4 mayo, 17:02, baur79 <[EMAIL PROTECTED]> wrote:
> i have model "contract" and
> 3 types of users manager / lawyer / broker
>
> each of them have different privileges on this model
>
> for example:
> manager can only edit several fields
> lawyer can do everything on model
> broker can only see
Thank you for the feedback. The beforeSave() trick could be one
possibilty, but in this particular case it seems that the
defaultPhotoId suggested by Goranche is the easiest.
On 18 ene, 15:27, Jaime <[EMAIL PROTECTED]> wrote:
> Hello bakers!
>
> Imagine this (common) scenario: a p
Hello bakers!
Imagine this (common) scenario: a photo album that HasMany photos. A
user may select one of them as a "cover" or "default" photo to
illustrate the cover of the album. So a boolean field called "default"
is set in the Photo model. Of course one and only one photo within
that album sh
63 matches
Mail list logo