Cphalcon: NFR: add a way to clear prependTitle or appendTitle

Created on 20 Sep 2016  路  8Comments  路  Source: phalcon/cphalcon

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

Most helpful comment

@borisdelev BC = Backward Compatibility.

All 8 comments

@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 BC = Backward Compatibility.

@Green-Cat Thank you!

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 Please don't worry about it yet. I will need some time to fix the tests

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

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

Implemented in the 3.1.x branch. Thanks

Was this page helpful?
0 / 5 - 0 ratings