cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

NFR: add a way to clear prependTitle or appendTitle

Open borisdelev opened this issue 10 years ago • 8 comments

Hi there... i have idea about prependTitle and appendTitle- to manage and clear them. Maybe will be useful. What is you opinion?

Now

If we want to clear append or prepend title, must clear all values

\Phalcon\Tag::setTitleSeparator(' - ');
\Phalcon\Tag::setTitle('Title');

// Somewhere in controller
\Phalcon\Tag::prependTitle('Category');
\Phalcon\Tag::prependTitle('Article');

// In some situation, just want to clear all prepended element
\Phalcon\tag::resetInput();
\Phalcon\Tag::setTitleSeparator(' - ');
\Phalcon\Tag::setTitle('Title');
\Phalcon\Tag::prependTitle('Just article');

Idea

A way to clear elements and to add multiple elements at once (why not).

\Phalcon\Tag::setTitleSeparator(' - ');
\Phalcon\Tag::setTitle('Title');

// Somewhere in controller
\Phalcon\Tag::prependTitle('Category');
\Phalcon\Tag::prependTitle('Article');

// Same situation - clear and put just one prepend element (will be faster than clear all values)
\Phalcon\Tag::prependTitle(['Just article']);

// Or other - clear and put a few elements
\Phalcon\Tag::prependTitle(['Other category', 'Other article']);

Details

  • Phalcon version: 3.0.0 x64
  • PHP Version: 7.0.11 x64
  • Operating System: Windows 10
  • Server: Apache x64
  • Other related info (Database, table schema): MariaDB x64

Hope you understand me. Thanks

borisdelev avatar Sep 20 '16 07:09 borisdelev

@sergeyklay it is out of topic, but please, if u have time... explain what mean BC?

So now _documentPrependTitle is array or null and this breaking BC

borisdelev avatar Sep 20 '16 13:09 borisdelev

@borisdelev BC = Backward Compatibility.

Green-Cat avatar Sep 20 '16 13:09 Green-Cat

@Green-Cat Thank you!

borisdelev avatar Sep 20 '16 14:09 borisdelev

Hi @sergeyklay ...

I try to make this feature, but for some reason travis-ci builds return error about "SessionTest"... i didnt modified anything connected with session. Is there something or i do wrong?

Thank you!

borisdelev avatar Dec 09 '16 14:12 borisdelev

@borisdelev Please don't worry about it yet. I will need some time to fix the tests

sergeyklay avatar Dec 09 '16 19:12 sergeyklay

I will fix those problems here - https://github.com/phalcon/cphalcon/pull/12445/commits just need to sit to it and finish this feature.

Jurigag avatar Dec 09 '16 19:12 Jurigag

Thank you! :) Wish u luck and prosper :)

borisdelev avatar Dec 11 '16 18:12 borisdelev

Implemented in the 3.1.x branch. Thanks

sergeyklay avatar Dec 11 '16 22:12 sergeyklay