Hi,
I have a page, where I want to display my blog posts by calling a
requestAction to a function called frontindex() function.
public function frontindex() {
$all = $this-Post-find('all', array('order' = 'created
DESC'));
$this-set('posts', $all);
return $all;
}
I am
Hi,
I have a page, where I want to display my blog posts by calling a
requestAction to a function called frontindex() function.
public function frontindex() {
$all = $this-Post-find('all', array('order' = 'created
DESC'));
$this-set('posts', $all);
return $all;
}
I am
Hi
I would ask how can I access to $this-webroot controller's variable
from a model?
Many Thanks
Marco
--
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
use Helper::url('/')
2012/1/2 byqsri marco.rizze...@gmail.com
Hi
I would ask how can I access to $this-webroot controller's variable
from a model?
Many Thanks
Marco
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions
Laerte M. Rodrigues
You meant Router::url(), right?
It will return proper value through web, but not in cli at edge cases.
Recommended way is manually to use Model::set() method or receive
value via property, like $Post-webroot = $this-webroot(or
Post::$webroot = ...).
Because testing it is
I use Cakephp 2.0 and the static method Helper::url('/') return the URL
from WebRoot
2012/1/2 清水紘己 hiromi2...@gmail.com
Laerte M. Rodrigues
You meant Router::url(), right?
It will return proper value through web, but not in cli at edge cases.
Recommended way is manually to use Model::set()
he is probably need absolute path for webroot, not browser :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/1/2 Laerte M. Rodrigues laertemat...@gmail.com
I use Cakephp 2.0 and the static method Helper::url('/') return the URL
from WebRoot
2012/1/2 清水紘己 hiromi2...@gmail.com
Bump!
On Dec/28, Matteo Landi wrote:
Hi everybody,
I have a custom exception handler for all the exceptions raised inside
controllers; when I run the controllers' testsuite, I noticed that exceptions
are propagated to the tests instead of being handled by my handler. Is this
the
normal
Bump!
On Dec/28, Matteo Landi wrote:
Excuse me for bringing up this old topic, but I have one more question.
My TestController wrapper object contains a method which tests the
authentication layer (it's a custom layer, not the one shipped within
cakephp);
consequently all the controllers'
if they have the absolute path, use const WEBROOT_DIR
2012/1/2 Tilen Majerle tilen.maje...@gmail.com
he is probably need absolute path for webroot, not browser :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/1/2 Laerte M. Rodrigues laertemat...@gmail.com
I use Cakephp 2.0 and
Woudnt it make sense for the CakeSession to modify the
session.gc_maxlifetime param, as well?
As of right now it just sets the other params.
But the session file still gets deleted way too soon in many cases
The default setting is absurd: 1440 = 24 minutes
The question is - in what cases does the
I want to display a complete other homepage when user is logged in,
but I don't want him to access the logged out user.
I thought I could use something like this :
?php
if ($this-Session-check('Auth.User.id')) {
echo(logged);
}
?
and replacing the echo by $this-redirect, but this doesn't work
you want to display some content only, if user is logged in right ?
you can do in a view something like that
if ($this-Session-check('Auth.User.id'))
{
//render element for example
}
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/1/2 J. contact.mysparet...@gmail.com
I want to display
In the controller you can use either:
if($this-Auth-user(User.id)){
$this-redirect(/homepage2);
// or
$this-render(homepage2);
}
Il 02/01/2012 14:42, Tilen Majerle ha scritto:
you want to display some content only, if user is logged in right ?
you can do in a view something like that
A simple way could be checking if the user is logged in, like
public function beforeFilter() {
parent::beforeFilter();
if($this-Auth-user()) {
$this-Auth-allow(array('index', 'frontindex'));
}
}
Il 02/01/2012 10:18, heohni ha scritto:
Hi,
I have a page, where
Currently working over cakephp 2.0.4. i have two users admin and
user. i'm stuck over the part where we need to grant permissions for
the user or a regular user. do i need to type any commands inside
the app folder ?
--
Our newest site for the community: CakePHP Video Tutorials
Surely setting the allow variable is enough. If the user is not logged, they
are not allowed. Simple. No need to check further, let the auth component do it.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 2 Jan 2012, at 14:39:11, luca capra wrote:
A simple way could be checking if
Requesting the Gurus again.
Any help would be a great favor.
--
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
But now I not a step further?
Does anyone has a hint for me?
--
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
I want to display both feat. and last posts on my home page.
So, in my Pages controller, I have this :
$this-loadModel('Post');
$posts = $this-set('posts', $this-Post-find('all',
array('conditions' = array('Post.featured' = '1'),'limit' = 10)));
and in my view I
Thanks a lot !
On 2 jan, 15:32, luca capra luca.ca...@gmail.com wrote:
In the controller you can use either:
if($this-Auth-user(User.id)){
$this-redirect(/homepage2);
// or
$this-render(homepage2);
}
Il 02/01/2012 14:42, Tilen Majerle ha scritto:
you want to display
create a second query, pass the result on to the view and loop over it
absolutely no different from your above code.
On 2 Jan., 16:00, J. contact.mysparet...@gmail.com wrote:
I want to display both feat. and last posts on my home page.
So, in my Pages controller, I have this :
But I can't habe both of them named $posts, right ?
this-loadModel('Post');
$posts = $this-set('posts', $this-Post-find('all',
array('conditions' = array('Post.featured' = '1'),'limit' = 10)));
$posts2 = $this-set('posts', $this-Post-
find('all',
array('conditions'
Hi,
$this-set specifies the variable name that is supposed to be used in
the template, so your code snippet should look like this:
$this-set('posts', $this-Post-find('all', array('conditions' =
array('Post.featured' = '1'),'limit' = 10)));
$this-set('posts2',
Didn't knew this. Thanks a lot, works perfectly !
On 2 jan, 18:36, Linas Jakucionis lin...@gmail.com wrote:
Hi,
$this-set specifies the variable name that is supposed to be used in
the template, so your code snippet should look like this:
$this-set('posts', $this-Post-find('all',
Hi all.
I am currently struggling with localizing my created and modified
values from db.
I am using the Time helper, and have tried to get it to output real
nice.
echo $time-niceShort($post['Post']['created']);
This gived me the Today, Yesterday, and Dec 29th 2011, 23:33
Translating of the
Hello all,
I've been struggling on this for the last two days. I'm creating a
webshop on which people should be able to filter products on multiple
tags. Database structure is the following:
Tags = Id | Name
Products = Id | Category_id | Name | etc...
Tags_Products | Id | Product_id | Tag_id
Hallo zusammen
Ich wende zum ersten Mal cakephp an und habe auch bereits eine erste
Ansicht mit Abfrage hinbekommen. Nun möchte ich in einem Formular ein
Dropdown-Feld generieren aus einer Tabelle, die bisher nichts mit dem
Controller zu tun hat. Die Tabelle heisst countries und angezeigt
werden
You are absolutely right.
I just enabled pdo_mysql on my php.ini and it worked!
Ronghua: try this hint. Worked for me.
--
Renato Freire
2012/1/1 清水��己 hiromi2...@gmail.com
My last guess is pdo mysql is not enabled.
2012/1/1 Renato de Freitas Freire renat...@gmail.com:
I had the same
Hi all!
One question on routing: due to a poor previous configuration I would
need all the requests for image files sent to /app/attachments/... be
seen by Cake as sent to /attachments/... (where /attachments is a
folder in webroot, just like /img) so that the image can be served
instead of
one question:
is fixing the obvious error in the poor previous configuration not
an option?
if would probably fix other similar errors, as well
On 2 Jan., 20:09, Mario mario.calli...@gmail.com wrote:
Hi all!
One question on routing: due to a poor previous configuration I would
need all the
Ty for the answer.
Fixed everywhere, but unfortunately is not an option for an already
shipped mobile app client...
Of course future versions will take care of the issue, but I would
like to solve it server side also for the existing ones.
Best,
Mario
On Jan 2, 8:31 pm, euromark
Como diablos saco este mensaje de la primera aplicacion de illasaron,
estoy con cake 2.0.4
preg_match() [function.preg-match]: Delimiter must not be alphanumeric
or backslash
Por favor una ayuda.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the
English please ! :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/1/2 Munizaga francisco.muniza...@gmail.com
Como diablos saco este mensaje de la primera aplicacion de illasaron,
estoy con cake 2.0.4
preg_match() [function.preg-match]: Delimiter must not be alphanumeric
or backslash
All,
I am looking for the easiest, most global way to set a couple of app-
wide constants, more or less, that would derive from Apache variables,
specifically $_SERVER['REMOTE_USER'] and $_SERVER['REMOTE_ADDR'] and
that would be used throughout the app both in models and controllers.
A
yes, you can use Configure::write()
that's absolute fine, but try to set it in bootstrap.php if they are
supposed to be global (side wide)
that would be a cleaner approach than using some AppController method
to do so.
On 2 Jan., 22:48, geste jim.ho...@gmail.com wrote:
All,
I am looking for
This is really not a configuration item, though you can set it using
Configure::write(). Of course, $_SERVER['REMOTE_ADDR'] must be
provided by your web server.
http://php.net/manual/en/reserved.variables.server.php
If you are trying to create a user setting, a session cookie would be
much more
Hello, i have trouble to use Session component inside my plugin components.
How to load session component?
--
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
On Jan 2, 4:16 am, Geoff Douglas drdouglas...@gmail.com wrote:
There are several ways to do that.
Here are a few that I can think of off the top of my head:
There are wysiwyg (like TinyMCE) editors,
OR markup language options such as Textile, or Markdown, or bbCode, or
WikiCreole
If you
Thanks for your response.
(This app can only be accessed via an Apache auth module that sets
REMOTE_USER)
On Jan 2, 2:13 pm, euromark dereurom...@googlemail.com wrote:
yes, you can use Configure::write()
that's absolute fine, but try to set it in bootstrap.php if they are
supposed to be
Gary, euromark,
OK, yes I was able use Configure::write in boostrap.php.
If I can just use the CakePHP database connector, I think I'll just
write a small snippet that looks up that secondary identifier and add
that to bootstrap.php.
Thanks,
J
On Jan 2, 2:35 pm, bujanga buja...@gmail.com
You need to see following section of the manual with LC_TIME keyword:
http://book.cakephp.org/2.0/en/appendices/new-features-in-cakephp-1-3.html?highlight=lc_time
The Book seems to be unkind for it, TimeHelper, not appendices,
document should have detail information I think!
2012/1/3 MetZ
Hi all, just a quick question. I have a simple model association between a
Work and Image model with a one-to-many association between the two. When I
call saveAll on the Work model it'll save the associated images as well.
But when validation errors occur on the Work and images, it seems that
Undefined property: TwitterAuthComponent::$Session
[*APP/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php*, line *133*]
Fatal error: Call to a member function check() on a non-object in
/home/nix/localhost.dev/cms/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php
on
did you forget to add
var $components = array('Session')
to this component? that's probably it
On 3 Jan., 02:04, Salines nikola.parad...@gmail.com wrote:
Undefined property: TwitterAuthComponent::$Session
[*APP/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php*, line
*133*]
my favorite is bbcode, as well. clean, understandable for visitors and
easy to adjust and extend. it also has a high level of security if
applied correctly.
I also like that it decouples html from the markup.
you can add stuff like [youtube]someid[/youtube] etc which will
translate into the real
You can use a simple way in app_controller like
var $ipaddr=$_SERVER['REMOTE_ADDR'];
and access in any controller function like:
echo $this-ipaddr;
On Jan 2, 7:12 pm, geste jim.ho...@gmail.com wrote:
Gary, euromark,
OK, yes I was able use Configure::write in boostrap.php.
If I can just use
There's no point in doing two identical finds - it's inefficient. If you really
want two variables with exactly the same content, do this:
$posts = $this-Post-find('all', array('conditions' = array('Post.featured'
= '1'),'limit' = 10)));
$this-set('posts', $posts);
$this-set('posts2', $posts);
Take a look at this: https://github.com/CakeDC/search It'll do this for you
very nicely.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 2 Jan 2012, at 18:10:23, Dwayne Hanekamp wrote:
Hello all,
I've been struggling on this for the last two days. I'm creating a
webshop on
arif
Are you using download link on website?Then here is answer
?php $html-link('Pdf', '/files/myfile.pdf'); ?
or
?php echo $html-link('pdf', $this-webroot('files'.DS.'test.pdf'); ?
or for newer version of cakephp
?php echo $html-link('pdf', $html-webroot('files'.DS.'test.pdf'); ?
or
a
hi
you can use
$featuredposts=$this-Post-find('all',array('conditions' =
array('Post.featured' = '1'),'limit' = 10));
$this-set('featured',$eaturedposts);
$lastposts=$this-Post-find('all',array('order' = array('Post.id
DESC'),'limit' = 10));
$this-set('lastposts',$lastposts);
On Jan 2, 8:00
On Dec 30 2011, 9:45 am, Tilen Majerle tilen.maje...@gmail.com
wrote:
http://www.megaupload.com/?d=0UI55OY3
This works for me in 2.0 :)
Why on earth would you distribute code via megaupload?
AD
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out
On Jan 2, 9:37 pm, Mario mario.calli...@gmail.com wrote:
Ty for the answer.
Fixed everywhere, but unfortunately is not an option for an already
shipped mobile app client...
Of course future versions will take care of the issue, but I would
like to solve it server side also for the existing
I would like to have somewhere ~1 sec load time
I actually figured out the problem though. When using persistModel = true
it actually caused ALOT of unexpected speed results. I removed it and all
calls are around 1 - 3 seconds.
Also, automagic form elements wont load with it for some
Thank you for the suggestion, I will give it a try.
--
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
On Dec 28 2011, 4:22 pm, Matteo Landi mat...@matteolandi.net wrote:
Hi everybody,
I have a custom exception handler for all the exceptions raised inside
controllers; when I run the controllers' testsuite, I noticed that exceptions
are propagated to the tests instead of being handled by my
That makes a lot more sense.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 3 Jan 2012, at 05:48:21, Kanwal wrote:
hi
you can use
$featuredposts=$this-Post-find('all',array('conditions' =
array('Post.featured' = '1'),'limit' = 10));
$this-set('featured',$eaturedposts);
On Jan 3, 6:55 am, Dee Johnson devario...@gmail.com wrote:
I would like to have somewhere ~1 sec load time
I actually figured out the problem though. When using persistModel = true
it actually caused ALOT of unexpected speed results. I removed it and all
calls are around 1 - 3 seconds.
On Dec 29 2011, 4:41 pm, Alex Bovey a...@bovey.co.uk wrote:
Hi all,
I've just moved a site (at the client's request) from my own VPS where it
was performing very well to some cheap shared hosting (123-reg.co.uk) and
surprise surprise it's pretty slow.
Using the DebugKit Toolbar I'm seeing
http://milesj.me/blog/read/caching-queries
On Jan 2, 10:09 pm, AD7six andydawso...@gmail.com wrote:
On Jan 3, 6:55 am, Dee Johnson devario...@gmail.com wrote:
I would like to have somewhere ~1 sec load time
I actually figured out the problem though. When using persistModel = true
Hi all,
I'm looking for a way to return a generic error every time something
goes wrong with a REST request. So for example, I would like to
return a simple, XML response like:
error
There was a problem processing your request.
/error
Anytime something goes wrong when something is accessed via
you rite adsix. .agree . see where the problem caused and fix it..and if
you already optimize everything before need the debug kit it will safe you
too...
for the os level well, every kernel of linux can be optimized, some came
with default server usage setting, with of course different workload
62 matches
Mail list logo