Greetings All,
I need to optimize a RegEx I am using to parse template tags in my CMS. A tag can be either a single tag or a matching pair. An example of some tags:
{static:input:title type="input"}
{static:image:picture}<img src="{$img.src}" width="{$img.width}" height="{$img.height"} />{/static:image:picture}
Here is the RegEx I...
When I upload a picture
File size: 375kb
Width: 2000px
Height: 3000p
I get an error
ERROR
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 2157 bytes) in...
Why this happen, when 67108864 = 64MB
I use shared server if .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ...
I tried to install CakePHP on my home Ubuntu 10.04 desktop for development/testing purposes, and I believe I have gone through all the appropriate steps. However, I am still running into the problem that my layout is broken. I believe this is a DocumentRoot or mod_rewrite problem, but I don't have enough experience in Apache to diagnose ...
Hi,
I am using the JS helper in Cake 1.3 and due to the need to use jQuery in noConflict mode, I have to set this in every view:
$this->Js->JqueryEngine->jQueryObject = 'jQuery';
I have a LOT of views that rely on this, and I'd like to avoid having to enter this line at the top of every view that needs it. I tried setting the jQueryOb...
I'm working in a CakePHP Model class, writing a function that is supposed to perform a whole bunch of manipulations on the model. I'm trying to follow the skinny controller, fat model idea. However, I don't seem to be able to call any of the model's functions from with in my model. Something hasn't been initialized yet, because I get ...
I am building a cakephp app - its a food recommendation service. and i would like to have mobile views for that.
i just wanted to know of the best practise on how it can be done.
Problem is i will have to feed mobile views and city also
i wil have few cities which
so to address a City 1
its will be either city1.website.com or websit...
Hi,
I am using cakephp. I have a form with an element array.
For ex:-
<textarea name="data[User][0][description]>
<textarea name="data[User][1][description]>
From the controller, I need to invalidate (manually) the array field if it is empty and need to show errors to the respective field.
What is the correct syntax for invalidatin...
Hi,
I'm using the truncate method of the text helper and in doing so means any html included in the text is being rendered. Is there anyway to set the text helper to strip out html tags?
echo $text->truncate(
$project['Project']['description'],
250,
array(
...
Simple question from an absolute n00b.
I'm trying to create an edit content screen based on the code given in the Blog Tutorial on the Cake site.
Here's my edit function in the controller (it's named Contents):
function edit( $id = null ) {
$this->Content->id = $id;
Debugger::dump( $this->Content->id );
if( empty( $this->...
Hi to all
I have this strange error in my code.
I want to make a cookie system with cakephp, and in app_controller.php I include
var $components = array('Auth', 'Cookie');
var $helpers = array('Html', 'Form', 'Session');
but everytime I click on Logout link the error appears.
This is the function
function logout() {
$cookie = $th...
Hi,
I have developped a full website with CakePHP framework and we'd like to make a very light version of the website for mobile devices (mainly iPhone/iPad).
Is there a way to use the existing website with a new sub domain (for instance mobile.mywebsite.com) which will render specific views? I would like to avoid copying and simplifyin...
Hello
I was trying to create an admin for my controller Posts, I used cake console option to create controller, I type Y for the question "Need admin routing ?", I entered Y and I got written my controller with admin functions, one of my admin function looks like this
function admin/controller_view($id = null) {
if (!$id) {
...
I have a CakePHP website that's been working great.
I just developed a new functionality that at one point auto-logs the user in, and redirects him to a page that's behind the login wall.
This works perfectly well in my dev machine, but in production, the user gets redirected to the login page.
Relevant code: (not much)
$objCusto...
I have a CakePHP shell program called 'match', which runs through my database performing some fairly complicated stuff.
I'm writing another shell so I can do some proof-of-concept simulation, this shell is called 'simulate'.
I need 'simulate' to be able to call 'match', then continue running. As the simulation will
repeat many differe...
I would like to write a cake shell to do a nightly backup of my database using mysqldump. I could do this as a shell script, but if I can cram it into a CakePHP shell, then I will get the added benefit of it working across both the development and live server, if I can get it to automagically read my database config settings. I will cron...
$js->writeBuffer(array('cache' => true));
it create > 7000 files cache in folder webroot/js/ mywebsite in 10 days.
How to delete auto for this
...
In Cakephp is there a better way to write this:
$unread_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'unread') ));
$read_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'read') ));
$dispatched = $this->Order->find('all', array('conditions' => array('Order.status' => 'd...
I have cakephp installed in the root directory. site.com/
i want to install wordpress blog at site.com/blog
but since cakephp will redirect all urls i am not sure how to do it ?
...
Hi,
I have an index action in my users_controller that get a list of users. For each user i want to calculate the number of projects they have associated (one user => many projects). I was thinking of using a method like getProjectTotal and calling it for each user. Would I put this method in the users_controller and call it like
$thi...
I have a relatively simple site on my hands, and have for nearly a year, but I can't seem to find a platform to build it on that doesn't fight back at the way I want to do things. Here are the key features:
Customizable profiles. Profile tags.
Two primary content types: Haves & Wants
Both content types searchable/taggable and expire wi...