Davide wrote:
> unfortunly Router::connect() seems not to work for me. Cake
> 1.1.18. It's simply ignored. But you gave me a hint and using
> $Route->connect(...) I can achieve my goal.
>
> However I have to add a $Route->connect() for each action and it's not
> beautiful and subject to errors. I'
Joel Perras wrote:
> ...
> For that, use:
> (app/config/routes.php)
> Router::connect('/projects/:name', array('action'=>'view',
> 'name'=>null));
> ...
Thanks Joel,
unfortunly Router::connect() seems not to work for me. Cake
1.1.18. It's simply ignored. But you gave me a hint and using
$Route->
Whoops, didn't see that you wanted to also refer to the unique name of
the project. So A few more lines.
For that, use:
(app/config/routes.php)
Router::connect('/projects/:name', array('action'=>'view',
'name'=>null));
And in your projects/view controller/action pair:
function view() {
if (
How about in one line?
In the app/config/routes.php file:
Router::connect('/projects/:id', array('action' => 'view'), array('id'
=> '[0-9]+'));
-J.
On Apr 28, 10:31 am, "Davide" <[EMAIL PROTECTED]> wrote:
> I wrote a code (at the bottom) that in case of missingAction will search
> in the datab
I wrote a code (at the bottom) that in case of missingAction will search
in the database and if found then render the proper view.
Everything works fine except when I turn DEBUG=0 (production setup). Now
cake always render the 404 without entering the AppError::missingAction().
How can I do?
Fo
Davide wrote:
> ...
> How can I render the correct page without doing a redirect?
At the moment I've solved in this way. Don't know if it's the right
way but it's working.
Thanks a lot
Bye
Davide
findByName($params["action"]);
if(is_null($data) || empty($data)){
paren
To use an Alias with CakePHP, you need to add
RewriteBase /your_alias_name
to the app/webroot/.htaccess file (right after the RewriteEngine On
line). And you need to have
define ('WEBROOT_DIR', 'your_alias_name');
in your app/webroot/index.php
--~--~-~--~~~---~--~---